Skip to content

@ParameterObject: there are no parameters if there are no get methods in the model.  #32

@shaburov

Description

@shaburov

Version: org.springdoc:springdoc-openapi-ui:1.6.6

There are no parameters in swagger

  • If ParameterObject without get methods
    image
  • If ParameterObject has a fluent chain get methods (without get prefix)
    image

The only working option. If there is a getter and only prefixed with 'get'.

image

The problem lies in the fact that the DelegatingMethodParameter.customize() method calls inside MethodParameterPojoExtractor.extractFrom(paramClass) which operates on methods, but in fact it would be worth working directly with annotated fields.

Secondly, POJO, unlike JavaBean, does not require getters and setters. I can work with POJO fields directly if they are declared as public/package-privat/protected.

But the main problem is that this behavior is not documented ANYWHERE. Wasted a lot of time on trivia.
Add at least information about this nuance to https://springdoc.org/faq.html

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions