private void removeParentProperties(Schema child, Schema parent) { final Map<String, Schema> baseProps = parent.getProperties(); final Map<String, Schema> subtypeProps = child.getProperties(); if (baseProps != null && subtypeProps != null) { for (Map.Entry<String, Schema> entry : baseProps.entrySet()) { if (entry.getValue().equals(subtypeProps.get(entry.getKey()))) { subtypeProps.remove(entry.getKey()); } } } if (subtypeProps == null || subtypeProps.isEmpty()) { child.setProperties(null); } }
clonedModel.setProperties(clonedProperties);
props.put("dateValue", new DateSchema()); props.put("dateTimeValue", new DateTimeSchema()); pet.setProperties(props); pet.setRequired(Arrays.asList("intValue", "name")); final String json = "{\n" +
model.setProperties(updatedProperties);
model.setProperties(modelProps);
private void removeParentProperties(Schema child, Schema parent) { final Map<String, Schema> baseProps = parent.getProperties(); final Map<String, Schema> subtypeProps = child.getProperties(); if (baseProps != null && subtypeProps != null) { for (Map.Entry<String, Schema> entry : baseProps.entrySet()) { if (entry.getValue().equals(subtypeProps.get(entry.getKey()))) { subtypeProps.remove(entry.getKey()); } } } if (subtypeProps == null || subtypeProps.isEmpty()) { child.setProperties(null); } }
clonedModel.setProperties(clonedProperties);
protected static Schema addSchema(Schema schema, Schema fromSchema) { if (fromSchema.getProperties() != null) { if (schema.getProperties() == null) { schema.setProperties(fromSchema.getProperties()); } else { schema.getProperties().putAll(fromSchema.getProperties()); } } if (fromSchema.getRequired() != null) { if (schema.getRequired() == null) { schema.setRequired(fromSchema.getRequired()); } else { schema.getRequired().addAll(fromSchema.getRequired()); } } // TODO copy other things from fromSchema return schema; }
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } String name = object.getName(); XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema();//TODO Verify this! model.setDescription(description); model.setExample(example); model.setName(name); model.setXml(xml); model.setType(object.getType()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema(); model.setDescription(description); model.setExample(example); model.setName(object.getName()); model.setXml(xml); model.setRequired(object.getRequired()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } String name = object.getName(); XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema();//TODO Verify this! model.setDescription(description); model.setExample(example); model.setName(name); model.setXml(xml); model.setType(object.getType()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } String name = object.getName(); XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema();//TODO Verify this! model.setDescription(description); model.setExample(example); model.setName(name); model.setXml(xml); model.setType(object.getType()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
result.setProperties(properties);
result.setProperties(properties);
result.setProperties(properties);
schema.setProperties(properties);
schema.setProperties(properties);
schema.setProperties(properties);
model.setProperties(modelProps);