use of io.swagger.v3.jaxrs2.ext.OpenAPIExtension in project cxf by apache.
the class JaxRs2Extension method extractParameters.
@Override
public ResolvedParameter extractParameters(final List<Annotation> annotations, final Type type, final Set<Type> typesToSkip, final Components components, final Consumes classConsumes, final Consumes methodConsumes, final boolean includeRequestBody, final JsonView jsonViewAnnotation, final Iterator<OpenAPIExtension> chain) {
if (shouldIgnoreType(type, typesToSkip)) {
return new ResolvedParameter();
}
List<Parameter> parameters = annotations.stream().filter(annotation -> annotation instanceof MatrixParam).map(annotation -> {
MatrixParam param = (MatrixParam) annotation;
Parameter mp = new PathParameter().name(param.value());
mp.setStyle(Parameter.StyleEnum.MATRIX);
ResolvedSchema resolvedSchema = ModelConverters.getInstance().readAllAsResolvedSchema(type);
if (resolvedSchema != null) {
mp.setSchema(resolvedSchema.schema);
}
applyBeanValidatorAnnotations(mp, annotations);
return mp;
}).collect(Collectors.toList());
// Only call down to the other items in the chain if no parameters were produced
if (parameters.isEmpty()) {
return super.extractParameters(annotations, type, typesToSkip, components, classConsumes, methodConsumes, includeRequestBody, jsonViewAnnotation, chain);
}
ResolvedParameter resolved = new ResolvedParameter();
resolved.parameters = parameters;
return resolved;
}
Aggregations