private static void fillPayload(BodyParameter bodyParameter, PayLoad payload) { Model model = bodyParameter.getSchema(); payload.setDescription(model.getDescription()); if (model instanceof ArrayModel) { ArrayModel arrayModel = (ArrayModel) model; payload.setArray(true); payload.setType(SwaggerTypes.toDefinitionType(arrayModel.getItems())); } else if (model instanceof RefModel) { RefModel refModel = (RefModel) model; payload.setType(refModel.getSimpleRef()); } else { // FIXME: should we fail ? LOGGER.warning("Unsupported input payload type: " + model.getClass().getSimpleName()); } }
private static void fillPayload(BodyParameter bodyParameter, PayLoad payload) { Model model = bodyParameter.getSchema(); payload.setDescription(model.getDescription()); if (model instanceof ArrayModel) { ArrayModel arrayModel = (ArrayModel) model; payload.setArray(true); payload.setType(SwaggerTypes.toDefinitionType(arrayModel.getItems())); } else if (model instanceof RefModel) { RefModel refModel = (RefModel) model; payload.setType(refModel.getSimpleRef()); } else { // FIXME: should we fail ? LOGGER.warning("Unsupported input payload type: " + model.getClass().getSimpleName()); } }
private static void fillPayload(BodyParameter bodyParameter, PayLoad payload) { Model model = bodyParameter.getSchema(); payload.setDescription(model.getDescription()); if (model instanceof ArrayModel) { ArrayModel arrayModel = (ArrayModel) model; payload.setArray(true); payload.setType(SwaggerTypes.toDefinitionType(arrayModel.getItems())); } else if (model instanceof RefModel) { RefModel refModel = (RefModel) model; payload.setType(refModel.getSimpleRef()); } else { // FIXME: should we fail ? LOGGER.warning("Unsupported input payload type: " + model.getClass().getSimpleName()); } }
private static void fillPayload(BodyParameter bodyParameter, PayLoad payload) { Model model = bodyParameter.getSchema(); payload.setDescription(model.getDescription()); if (model instanceof ArrayModel) { ArrayModel arrayModel = (ArrayModel) model; payload.setArray(true); payload.setType(SwaggerTypes.toDefinitionType(arrayModel.getItems())); } else if (model instanceof RefModel) { RefModel refModel = (RefModel) model; payload.setType(refModel.getSimpleRef()); } else { // FIXME: should we fail ? LOGGER.warning("Unsupported input payload type: " + model.getClass().getSimpleName()); } }
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); }
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); }