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 fillOutputPayload(Response swaggerResponse, org.restlet.ext.platform.internal.model.Response response, Operation swaggerOperation, Contract contract, Map<String, Object> parameters) { Property property = swaggerResponse.getSchema(); if (property == null) { return; } PayLoad payload = null; if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; Object declaredPayload = parameters.get(refProperty.get$ref()); if (declaredPayload != null && declaredPayload instanceof PayLoad) { payload = (PayLoad) declaredPayload; } } if (payload == null) { payload = new PayLoad(); payload.setDescription(property.getDescription()); payload.setArray(property instanceof ArrayProperty); payload.setType(SwaggerTypes.toDefinitionType(property)); } Representation representation = contract.getRepresentation(payload.getType()); if (representation != null) { representation.addSections(swaggerOperation.getTags()); } response.setOutputPayLoad(payload); }
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 fillOutputPayload(Response swaggerResponse, org.restlet.ext.apispark.internal.model.Response response, Operation swaggerOperation, Contract contract, Map<String, Object> parameters) { Property property = swaggerResponse.getSchema(); if (property == null) { return; } PayLoad payload = null; if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; Object declaredPayload = parameters.get(refProperty.get$ref()); if (declaredPayload != null && declaredPayload instanceof PayLoad) { payload = (PayLoad) declaredPayload; } } if (payload == null) { payload = new PayLoad(); payload.setDescription(property.getDescription()); payload.setArray(property instanceof ArrayProperty); payload.setType(SwaggerTypes.toDefinitionType(property)); } Representation representation = contract.getRepresentation(payload.getType()); if (representation != null) { representation.addSections(swaggerOperation.getTags()); } response.setOutputPayLoad(payload); }
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 fillOutputPayload(Response swaggerResponse, org.restlet.ext.platform.internal.model.Response response, Operation swaggerOperation, Contract contract, Map<String, Object> parameters) { Property property = swaggerResponse.getSchema(); if (property == null) { return; } PayLoad payload = null; if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; Object declaredPayload = parameters.get(refProperty.get$ref()); if (declaredPayload != null && declaredPayload instanceof PayLoad) { payload = (PayLoad) declaredPayload; } } if (payload == null) { payload = new PayLoad(); payload.setDescription(property.getDescription()); payload.setArray(property instanceof ArrayProperty); payload.setType(SwaggerTypes.toDefinitionType(property)); } Representation representation = contract.getRepresentation(payload.getType()); if (representation != null) { representation.addSections(swaggerOperation.getTags()); } response.setOutputPayLoad(payload); }
private static void fillOutputPayload(Response swaggerResponse, org.restlet.ext.platform.internal.model.Response response, Operation swaggerOperation, Contract contract, Map<String, Object> parameters) { Property property = swaggerResponse.getSchema(); if (property == null) { return; } PayLoad payload = null; if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; Object declaredPayload = parameters.get(refProperty.get$ref()); if (declaredPayload != null && declaredPayload instanceof PayLoad) { payload = (PayLoad) declaredPayload; } } if (payload == null) { payload = new PayLoad(); payload.setDescription(property.getDescription()); payload.setArray(property instanceof ArrayProperty); payload.setType(SwaggerTypes.toDefinitionType(property)); } Representation representation = contract.getRepresentation(payload.getType()); if (representation != null) { representation.addSections(swaggerOperation.getTags()); } response.setOutputPayLoad(payload); }
private static void fillOutputPayload(Response swaggerResponse, org.restlet.ext.platform.internal.model.Response response, Operation swaggerOperation, Contract contract, Map<String, Object> parameters) { Property property = swaggerResponse.getSchema(); if (property == null) { return; } PayLoad payload = null; if (property instanceof RefProperty) { RefProperty refProperty = (RefProperty) property; Object declaredPayload = parameters.get(refProperty.get$ref()); if (declaredPayload != null && declaredPayload instanceof PayLoad) { payload = (PayLoad) declaredPayload; } } if (payload == null) { payload = new PayLoad(); payload.setDescription(property.getDescription()); payload.setArray(property instanceof ArrayProperty); payload.setType(SwaggerTypes.toDefinitionType(property)); } Representation representation = contract.getRepresentation(payload.getType()); if (representation != null) { representation.addSections(swaggerOperation.getTags()); } response.setOutputPayLoad(payload); }