@Override public Boolean apply(ApiModelProperty annotation) { return annotation.required(); } };
@Override public Boolean hasRequiredMarker(AnnotatedMember m) { ApiParam apiParam = m.getAnnotation(ApiParam.class); if (apiParam != null) { return apiParam.required(); } ApiModelProperty ann = m.getAnnotation(ApiModelProperty.class); if (ann != null) { return ann.required(); } XmlElement elem = m.getAnnotation(XmlElement.class); if (elem != null) { if (elem.required()) { return true; } } return null; }
.required(annotation.required()) .example(annotation.example().isEmpty() ? null : annotation.example()) .description(annotation.value().isEmpty() ? null : annotation.value()); property.setRequired(annotation.required()); return property .description(annotation.value()); property.setRequired(annotation.required()); return property .example(annotation.example()) property.setRequired(annotation.required()); return property .example(annotation.example()) property.setRequired(annotation.required()); return property .example(annotation.example()) property.setRequired(annotation.required()); property.setExample(annotation.example()); return property property.setRequired(annotation.required()); property.setExample(annotation.example()); return property property.setRequired(annotation.required());
private void fromApiModelProperty(ParameterExpansionContext context, ApiModelProperty apiModelProperty) { String allowableProperty = emptyToNull(apiModelProperty.allowableValues()); AllowableValues allowable = allowableValues( fromNullable(allowableProperty), context.getFieldType().getErasedType()); maybeSetParameterName(context, apiModelProperty.name()) .description(descriptions.resolve(apiModelProperty.value())) .required(apiModelProperty.required()) .allowableValues(allowable) .parameterAccess(apiModelProperty.access()) .hidden(apiModelProperty.hidden()) .scalarExample(apiModelProperty.example()) .order(SWAGGER_PLUGIN_ORDER) .build(); }