private RefModel toRefModel(String modelType) { if (RefProperty.class.isInstance(property)) { return (RefModel) PropertyBuilder.toModel(property); } ModelImpl modelImpl = new ModelImpl(); modelImpl.setType("object"); modelImpl.setName(name); modelImpl.addProperty(name, property); operationGenerator.getSwagger().addDefinition(modelType, modelImpl); RefModel refModel = new RefModel(); refModel.setReference("#/definitions/" + modelType); return refModel; } }
private Parameter replaceArrayModelForOctetStream(Operation operation, Parameter parameter) { if (parameter instanceof BodyParameter && operation.getConsumes() != null && operation.getConsumes().contains("application/octet-stream")) { BodyParameter bodyParam = (BodyParameter) parameter; Model schema = bodyParam.getSchema(); if (schema instanceof ArrayModel) { ArrayModel arrayModel = (ArrayModel) schema; Property items = arrayModel.getItems(); if (items != null && items.getFormat() == "byte" && items.getType() == "string") { ModelImpl model = new ModelImpl(); model.setFormat("byte"); model.setType("string"); bodyParam.setSchema(model); } } } return parameter; }
public ModelImpl type(String type) { this.setType(type); return this; }
@Override public void objectModel(ModelImpl objectModel) { if (objectModel.getType() == null) { objectModel.setType("object"); } } });
/** * Create a default Model for a failed PropertyBox type resolution. * @return The default unresolved schema */ private static Model buildUnresolvedPropertyBoxSchema() { final ModelImpl model = new ModelImpl(); model.setType(ModelImpl.OBJECT); model.setTitle("PropertyBox"); return model; }
/** * Get the model actual resolution to the {@link SwaggerV2ApiExtension}. * @return Delgate resolution model */ private static Model delegateToExtensionResolution() { final ModelImpl model = new ModelImpl(); model.setType(ModelImpl.OBJECT); model.setTitle("PropertyBox"); model.setVendorExtension(SwaggerExtensions.MODEL_TYPE.getExtensionName(), PropertyBox.class.getName()); return model; }
model.setType(modelName);
private RefModel toRefModel(String modelType) { if (RefProperty.class.isInstance(property)) { return (RefModel) PropertyBuilder.toModel(property); } ModelImpl modelImpl = new ModelImpl(); modelImpl.setType("object"); modelImpl.setName(name); modelImpl.addProperty(name, property); operationGenerator.getSwagger().addDefinition(modelType, modelImpl); RefModel refModel = new RefModel(); refModel.setReference("#/definitions/" + modelType); return refModel; } }
Function<Type, io.swagger.models.properties.Property> resolver, boolean includeReadOnly) { final ModelImpl model = new ModelImpl(); model.setType(ModelImpl.OBJECT); if (parent == null) { model.setTitle("PropertyBox");
messageModel.setType("object"); Map<String, Model> definitions = new HashMap<>(); if (!definitions.containsKey(ConverterConstants.ATTR_REQUEST)) {
private List<Parameter> readFormParameters(String methodName, java.lang.reflect.Parameter[] parameters) model.setType("object");
if (prop != null) { ModelImpl model = new ModelImpl(); model.setType(prop.getType()); bp.setSchema(model);
model.setType(property.getType()); model.setFormat(property.getFormat()); bodyParameter.setSchema(model);
model.setType(property.getType()); model.setFormat(property.getFormat()); bodyParameter.setSchema(model);
impl.setType(type);
model.setType(type); model.setFormat(format); model.setAllowEmptyValue(allowEmptyValue);