public RefProperty asDefault(String ref) { this.set$ref("#/definitions/" + ref); return this; } public RefProperty description(String description) {
return new RefProperty().asDefault(type);
/** * 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 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); }
.exclusiveMinimum(exclusiveMinimum) .exclusiveMaximum(exclusiveMinimum); if(RefProperty.isType(type, format)) property = new RefProperty(); if(EmailProperty.isType(type, format)) property = new EmailProperty()
return new RefProperty().asDefault(type);
/** * 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 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); }
return new RefProperty().asDefault(type);
/** * 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 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); }
public RefProperty(String ref) { super.type = "ref"; set$ref(ref); }
return new RefProperty().asDefault(type);
/** * 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 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); }
return new RefProperty().asDefault(type);
/** * 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 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); }