/** * Returns the RWADef type corresponding to the given Swagger Property. * * @param property * The Swagger property. * @return * The RWADef type. */ public static String toDefinitionType(Property property) { if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; return refProperty.getSimpleRef(); } else if (property instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) property; return toDefinitionType(arrayProperty.getItems()); } SwaggerTypeFormat swaggerTypeFormat = new SwaggerTypeFormat(property.getType(), property.getFormat()); return SwaggerTypes.toDefinitionPrimitiveType(swaggerTypeFormat); }
/** * Returns the RWADef type corresponding to the given Swagger Property. * * @param property * The Swagger property. * @return * The RWADef type. */ public static String toDefinitionType(Property property) { if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; return refProperty.getSimpleRef(); } else if (property instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) property; return toDefinitionType(arrayProperty.getItems()); } SwaggerTypeFormat swaggerTypeFormat = new SwaggerTypeFormat(property.getType(), property.getFormat()); return SwaggerTypes.toDefinitionPrimitiveType(swaggerTypeFormat); }
/** * Returns the RWADef type corresponding to the given Swagger Property. * * @param property * The Swagger property. * @return * The RWADef type. */ public static String toDefinitionType(Property property) { if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; return refProperty.getSimpleRef(); } else if (property instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) property; return toDefinitionType(arrayProperty.getItems()); } SwaggerTypeFormat swaggerTypeFormat = new SwaggerTypeFormat(property.getType(), property.getFormat()); return SwaggerTypes.toDefinitionPrimitiveType(swaggerTypeFormat); }
/** * Returns the RWADef type corresponding to the given Swagger Property. * * @param property * The Swagger property. * @return * The RWADef type. */ public static String toDefinitionType(Property property) { if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; return refProperty.getSimpleRef(); } else if (property instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) property; return toDefinitionType(arrayProperty.getItems()); } SwaggerTypeFormat swaggerTypeFormat = new SwaggerTypeFormat(property.getType(), property.getFormat()); return SwaggerTypes.toDefinitionPrimitiveType(swaggerTypeFormat); }
/** * Returns the RWADef type corresponding to the given Swagger Property. * * @param property * The Swagger property. * @return * The RWADef type. */ public static String toDefinitionType(Property property) { if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; return refProperty.getSimpleRef(); } else if (property instanceof ArrayProperty) { ArrayProperty arrayProperty = (ArrayProperty) property; return toDefinitionType(arrayProperty.getItems()); } SwaggerTypeFormat swaggerTypeFormat = new SwaggerTypeFormat(property.getType(), property.getFormat()); return SwaggerTypes.toDefinitionPrimitiveType(swaggerTypeFormat); }
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); } }
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); } }