use of org.motechproject.mds.docs.swagger.model.Parameter in project motech by motech.
the class SwaggerGenerator method includeBlobParameter.
private Parameter includeBlobParameter(Locale locale) {
Parameter includeBlobParameter = queryParameter(INCLUDE_BLOB_PARAM, msg(locale, BLOB_DESC_KEY), STRING_TYPE);
includeBlobParameter.setEnumValues(Arrays.asList("true", "false"));
return includeBlobParameter;
}
use of org.motechproject.mds.docs.swagger.model.Parameter in project motech by motech.
the class SwaggerGenerator method lookupParameters.
private List<Parameter> lookupParameters(Entity entity, Lookup lookup, Locale locale) {
List<Parameter> parameters = new ArrayList<>();
for (String lookupFieldName : lookup.getFieldsOrder()) {
LookupFieldType lookupFieldType = lookup.getLookupFieldType(lookupFieldName);
Field lookupField;
if (lookupFieldName.contains(".")) {
lookupField = getRelatedField(lookup.getLookupFieldByName(LookupName.getFieldName(lookupFieldName)).getMetadata(Constants.MetadataKeys.RELATED_CLASS).getValue(), LookupName.getRelatedFieldName(lookupFieldName));
} else {
lookupField = lookup.getLookupFieldByName(lookupFieldName);
}
String paramDesc = lookupParamDescription(lookupField, lookupFieldType, locale);
Parameter parameter = SwaggerFieldConverter.lookupParameter(lookupFieldName, lookupField, lookupFieldType, paramDesc);
parameters.add(parameter);
}
parameters.addAll(queryParamsParameters(entity.getFieldsExposedByRest(), locale));
return parameters;
}
use of org.motechproject.mds.docs.swagger.model.Parameter in project motech by motech.
the class SwaggerGenerator method parameter.
private Parameter parameter(String name, String description, String type, String format, ParameterType in, boolean required) {
final Parameter param = new Parameter();
param.setName(name);
param.setDescription(description);
param.setIn(in);
param.setRequired(required);
param.setType(type);
param.setFormat(format);
return param;
}
Aggregations