public Schema name(String name) { this.setName(name); return this; }
private void handleUnwrapped(List<Schema> props, Schema innerModel, String prefix, String suffix) { if (StringUtils.isBlank(suffix) && StringUtils.isBlank(prefix)) { if (innerModel.getProperties() != null) { props.addAll(innerModel.getProperties().values()); } } else { if (prefix == null) { prefix = ""; } if (suffix == null) { suffix = ""; } if (innerModel.getProperties() != null) { for (Schema prop : (Collection<Schema>) innerModel.getProperties().values()) { try { Schema clonedProp = Json.mapper().readValue(Json.pretty(prop), Schema.class); clonedProp.setName(prefix + prop.getName() + suffix); props.add(clonedProp); } catch (IOException e) { LOGGER.error("Exception cloning property", e); return; } } } } }
model.setName(toSnakeCase(model.getName())); context.defineModel(model.getName(), model, type, prevName);
String cloneName = property.getName(); property = Json.mapper().readValue(Json.pretty(property), Schema.class); property.setName(cloneName); } catch (IOException e) { LOGGER.error("Could not clone property, e"); property.setName(propName); JAXBAnnotationsHelper.apply(propBeanDesc.getClassInfo(), annotations, property); applyBeanValidatorAnnotations(property, annotations, model);
subtypeModel.setName(_typeNameResolver.nameForType(_mapper.constructType(subtypeType), TypeNameResolver.Options.SKIP_API_MODEL));
public Schema name(String name) { this.setName(name); return this; }
private void handleUnwrapped(List<Schema> props, Schema innerModel, String prefix, String suffix) { if (StringUtils.isBlank(suffix) && StringUtils.isBlank(prefix)) { if (innerModel.getProperties() != null) { props.addAll(innerModel.getProperties().values()); } } else { if (prefix == null) { prefix = ""; } if (suffix == null) { suffix = ""; } if (innerModel.getProperties() != null) { for (Schema prop : (Collection<Schema>) innerModel.getProperties().values()) { try { Schema clonedProp = Json.mapper().readValue(Json.pretty(prop), Schema.class); clonedProp.setName(prefix + prop.getName() + suffix); props.add(clonedProp); } catch (IOException e) { LOGGER.error("Exception cloning property", e); return; } } } } }
CodegenModel codegenModel = null; if (StringUtils.isNotBlank(name)) { schema.setName(name); codegenModel = fromModel(name, schema, schemas);
CodegenModel codegenModel = null; if (StringUtils.isNotBlank(name)) { schema.setName(name); codegenModel = fromModel(name, schema, schemas);
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } String name = object.getName(); XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema();//TODO Verify this! model.setDescription(description); model.setExample(example); model.setName(name); model.setXml(xml); model.setType(object.getType()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } String name = object.getName(); XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema();//TODO Verify this! model.setDescription(description); model.setExample(example); model.setName(name); model.setXml(xml); model.setType(object.getType()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } String name = object.getName(); XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema();//TODO Verify this! model.setDescription(description); model.setExample(example); model.setName(name); model.setXml(xml); model.setType(object.getType()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
public Schema modelFromProperty(ObjectSchema object, String path) { String description = object.getDescription(); String example = null; Object obj = object.getExample(); if (obj != null) { example = obj.toString(); } XML xml = object.getXml(); Map<String, Schema> properties = object.getProperties(); Schema model = new Schema(); model.setDescription(description); model.setExample(example); model.setName(object.getName()); model.setXml(xml); model.setRequired(object.getRequired()); if (properties != null) { flattenProperties(properties, path); model.setProperties(properties); } return model; }
} else { headerSchema = new StringSchema(); headerSchema.setName(header.getKey()); headerSchema.setDescription(headerProperty.getDescription()); headerSchema.setRequired(Stream.of(header.getKey()).collect(Collectors.toList()));
schema.setMinLength(sp.getMinLength()); schema.setMaxLength(sp.getMaxLength()); schema.setName(sp.getName());
schema.setMinLength(sp.getMinLength()); schema.setMaxLength(sp.getMaxLength()); schema.setName(sp.getName());
schema.setMinLength(sp.getMinLength()); schema.setMaxLength(sp.getMaxLength()); schema.setName(sp.getName());
subtypeModel.setName(_typeNameResolver.nameForType(_mapper.constructType(subtypeType), TypeNameResolver.Options.SKIP_API_MODEL));
property.setName(queryParameter.getName()); property.setDescription(queryParameter.getDescription()); addInternalExtensionToSchema(property, VEN_FROM_QUERY, Boolean.TRUE);