Skip to content

@ApiOperation with value only breaks displaying documentation for Api (controller) #32

Closed

Description

@szpak

Description:
I would expect to define only required properties in @apioperation and allow swagger4spring to get default values for others. Currently @apioperation with value only causes an API for a class (controller) to be not expandable in GUI.

How to reproduce:
In swagge4springweb-example (tested on master) for person() method in PersonController change @apioperation to @ApiOperation(value = "Find specific person").

Additional notes:
Maybe related thing - it would be nice to have to define response field only for not trival classes (e.g. wrappers like ResponseEntity). Currently even for simple classes defined as @apimodel (like Person) response type is not shown in GUI if response is not explicit defined.

Activity

  1. seawatts commented on Jan 13, 2014

    @seawatts

    I am having this exact same problem. There are quite a few bugs that have been introduced into this release that make this library not usable anymore.

    It looks like when you click the "Expand Operations" link next to the endpoint name it will show them all. The common theme I have seen for all the ones that you cannot open manually is they dont have a "Response Content Type"

  2. wkennedy commented on Jan 13, 2014

    @wkennedy
    Owner

    @szpak Thank you for posting this bug. I've created a fix for this issue. If there is no httpMethod specified in the ApiOperation annotation then it will look for the method in RequestMapping. As for your additional notes, I'll create a new issue for what you are describing. It sounds like you want to default to the method return type for the response in ApiOperation if no response is specified. This will be possible, unless you are using generics, in which case you will only see the collection class.

    @eibach I'm terribly sorry you are having so many issues with the newest release. Please post anything you find and I'll do my best to resolve these issues. To support the latest version of Swagger I needed to rewrite much of the code and I need some help sorting any issues that came out of the refactor.

  3. seawatts commented on Jan 13, 2014

    @seawatts

    Thanks wkennedy! I wasnt trying to be rude about it, I know it was a pretty big update on the swagger core spec. I saw you made a new release 0.3.1-SNAPSHOT. Is that available in maven?

  4. wkennedy commented on Jan 13, 2014

    @wkennedy
    Owner

    Oh, no worries! I know you weren't trying to be rude. I haven't deployed the 0.3.1 to the Maven repo yet. I'll do some more testing and hopefully get that pushed out tonight.

  5. seawatts commented on Jan 13, 2014

    @seawatts

    Great Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions