private ParameterImpl bindParam()

in geronimo-openapi-impl/src/main/java/org/apache/geronimo/microprofile/openapi/impl/processor/AnnotationProcessor.java [556:588]


    private ParameterImpl bindParam(final AnnotatedTypeElement annotatedElement,
                                    final OpenAPI openAPI) {
        final ParameterImpl parameter;
        final Parameter param = annotatedElement.getAnnotation(Parameter.class);
        if (param != null) {
            parameter = mapParameter(annotatedElement, () -> getOrCreateComponents(openAPI), param);
        } else {
            parameter = new ParameterImpl();
            if (annotatedElement.isAnnotationPresent(HeaderParam.class)) {
                parameter.in(org.eclipse.microprofile.openapi.models.parameters.Parameter.In.HEADER)
                        .style(org.eclipse.microprofile.openapi.models.parameters.Parameter.Style.SIMPLE)
                        .name(annotatedElement.getAnnotation(HeaderParam.class).value());
            } else if (annotatedElement.isAnnotationPresent(CookieParam.class)) {
                parameter.in(org.eclipse.microprofile.openapi.models.parameters.Parameter.In.COOKIE)
                        .style(org.eclipse.microprofile.openapi.models.parameters.Parameter.Style.FORM)
                        .name(annotatedElement.getAnnotation(CookieParam.class).value());
            } else if (annotatedElement.isAnnotationPresent(PathParam.class)) {
                parameter.required(true)
                        .in(org.eclipse.microprofile.openapi.models.parameters.Parameter.In.PATH)
                        .style(org.eclipse.microprofile.openapi.models.parameters.Parameter.Style.SIMPLE)
                        .name(annotatedElement.getAnnotation(PathParam.class).value());
            } else if (annotatedElement.isAnnotationPresent(QueryParam.class)) {
                parameter.in(org.eclipse.microprofile.openapi.models.parameters.Parameter.In.QUERY)
                        .style(org.eclipse.microprofile.openapi.models.parameters.Parameter.Style.FORM)
                        .name(annotatedElement.getAnnotation(QueryParam.class).value());
            }
        }
        if (parameter.getSchema() == null) {
            parameter.schema(schemaProcessor.mapSchemaFromClass(
                    () -> getOrCreateComponents(openAPI), annotatedElement.getType()));
        }
        return parameter;
    }