public List<String> getRequired() { List<String> output = new ArrayList<String>(); if(properties != null) { for(String key : properties.keySet()) { Property prop = properties.get(key); if(prop != null && prop.getRequired()) output.add(key); } } Collections.sort(output); if(output.size() > 0) return output; else return null; } public void setRequired(List<String> required) {
private static void fillRwadefProperties(Model model, Representation representation) { if (model.getProperties() == null) { return; } for (String key : model.getProperties().keySet()) { org.restlet.ext.platform.internal.model.Property property = new org.restlet.ext.platform.internal.model.Property(); Property swaggerProperty = model.getProperties().get(key); property.setDefaultValue(swaggerProperty.getDefault()); property.setDescription(swaggerProperty.getDescription()); // TODO: enumeration not implemented in Swagger 2.0 property.setExample(swaggerProperty.getExample()); property.setRequired(swaggerProperty.getRequired()); property.setList(swaggerProperty instanceof ArrayProperty); property.setName(key); // TODO: sub-properties not implemented in Swagger 2.0 // TODO: uniqueItems not implemented in Swagger 2.0 property.setUniqueItems(false); if (swaggerProperty instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) swaggerProperty; property.setExample(arrayProperty.getItems().getExample()); } property.setType(SwaggerTypes.toDefinitionType(swaggerProperty)); representation.getProperties().add(property); } }
private static void fillRwadefProperties(Model model, Representation representation) { if (model.getProperties() == null) { return; } for (String key : model.getProperties().keySet()) { org.restlet.ext.platform.internal.model.Property property = new org.restlet.ext.platform.internal.model.Property(); Property swaggerProperty = model.getProperties().get(key); property.setDefaultValue(swaggerProperty.getDefault()); property.setDescription(swaggerProperty.getDescription()); // TODO: enumeration not implemented in Swagger 2.0 property.setExample(swaggerProperty.getExample()); property.setRequired(swaggerProperty.getRequired()); property.setList(swaggerProperty instanceof ArrayProperty); property.setName(key); // TODO: sub-properties not implemented in Swagger 2.0 // TODO: uniqueItems not implemented in Swagger 2.0 property.setUniqueItems(false); if (swaggerProperty instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) swaggerProperty; property.setExample(arrayProperty.getItems().getExample()); } property.setType(SwaggerTypes.toDefinitionType(swaggerProperty)); representation.getProperties().add(property); } }
private static void fillRwadefProperties(Model model, Representation representation) { if (model.getProperties() == null) { return; } for (String key : model.getProperties().keySet()) { org.restlet.ext.apispark.internal.model.Property property = new org.restlet.ext.apispark.internal.model.Property(); Property swaggerProperty = model.getProperties().get(key); property.setDefaultValue(swaggerProperty.getDefault()); property.setDescription(swaggerProperty.getDescription()); // TODO: enumeration not implemented in Swagger 2.0 property.setExample(swaggerProperty.getExample()); property.setRequired(swaggerProperty.getRequired()); property.setList(swaggerProperty instanceof ArrayProperty); property.setName(key); // TODO: sub-properties not implemented in Swagger 2.0 // TODO: uniqueItems not implemented in Swagger 2.0 property.setUniqueItems(false); if (swaggerProperty instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) swaggerProperty; property.setExample(arrayProperty.getItems().getExample()); } property.setType(SwaggerTypes.toDefinitionType(swaggerProperty)); representation.getProperties().add(property); } }
private static void fillRwadefProperties(Model model, Representation representation) { if (model.getProperties() == null) { return; } for (String key : model.getProperties().keySet()) { org.restlet.ext.platform.internal.model.Property property = new org.restlet.ext.platform.internal.model.Property(); Property swaggerProperty = model.getProperties().get(key); property.setDefaultValue(swaggerProperty.getDefault()); property.setDescription(swaggerProperty.getDescription()); // TODO: enumeration not implemented in Swagger 2.0 property.setExample(swaggerProperty.getExample()); property.setRequired(swaggerProperty.getRequired()); property.setList(swaggerProperty instanceof ArrayProperty); property.setName(key); // TODO: sub-properties not implemented in Swagger 2.0 // TODO: uniqueItems not implemented in Swagger 2.0 property.setUniqueItems(false); if (swaggerProperty instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) swaggerProperty; property.setExample(arrayProperty.getItems().getExample()); } property.setType(SwaggerTypes.toDefinitionType(swaggerProperty)); representation.getProperties().add(property); } }
private static void fillRwadefProperties(Model model, Representation representation) { if (model.getProperties() == null) { return; } for (String key : model.getProperties().keySet()) { org.restlet.ext.platform.internal.model.Property property = new org.restlet.ext.platform.internal.model.Property(); Property swaggerProperty = model.getProperties().get(key); property.setDefaultValue(swaggerProperty.getDefault()); property.setDescription(swaggerProperty.getDescription()); // TODO: enumeration not implemented in Swagger 2.0 property.setExample(swaggerProperty.getExample()); property.setRequired(swaggerProperty.getRequired()); property.setList(swaggerProperty instanceof ArrayProperty); property.setName(key); // TODO: sub-properties not implemented in Swagger 2.0 // TODO: uniqueItems not implemented in Swagger 2.0 property.setUniqueItems(false); if (swaggerProperty instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) swaggerProperty; property.setExample(arrayProperty.getItems().getExample()); } property.setType(SwaggerTypes.toDefinitionType(swaggerProperty)); representation.getProperties().add(property); } }