use of org.glassfish.jersey.media.multipart.FormDataParam in project swagger-core by swagger-api.
the class SwaggerJersey2Jaxrs method extractParameters.
@Override
public List<Parameter> extractParameters(final List<Annotation> annotations, final Type type, final Set<Type> typesToSkip, final Iterator<SwaggerExtension> chain) {
List<Parameter> parameters = new ArrayList<Parameter>();
if (shouldIgnoreType(type, typesToSkip)) {
return parameters;
}
for (final Annotation annotation : annotations) {
// just handle the jersey specific annotation
if (annotation instanceof FormDataParam) {
FormDataParam fd = (FormDataParam) annotation;
if (java.io.InputStream.class.isAssignableFrom(constructType(type).getRawClass())) {
final Parameter param = new FormParameter().type("file").name(fd.value());
parameters.add(param);
} else {
final FormParameter fp = new FormParameter().name(fd.value());
final Property schema = ModelConverters.getInstance().readAsProperty(type);
if (schema != null) {
fp.setProperty(schema);
}
parameters.add(fp);
}
}
}
// Only call down to the other items in the chain if no parameters were produced
if (parameters.isEmpty()) {
parameters = super.extractParameters(annotations, type, typesToSkip, chain);
}
return parameters;
}
Aggregations