Skip to content

generated @ApiOperation should provide the nickname attribute #3473

@ralfstuckert

Description

@ralfstuckert

Swagger doc tools like e.g. springfox usually generate the operationId from code using the method name with a suffix (in springfox that's <method-name>Using<HTTP-verb>, e.g. myMethodUsingPost), in order to avoid name clashes due to multiple methods with the same name but different signatures.

That has a weird consequence if you generate a server from an existing swagger spec : the spec provided by the running server itself is different in that every operationId has been suffixed with Using<HTTP-verb>. In Springfox the only way to avoid this suffixing is to provide a nickname in the @ApiOperation annotation. And here comes the catch: since the code is generated, I do not want to edit that. So it would be nice, if the generator would add a nickname attribute to the annotation.

One could argue that this is a problem in springfox, but I guess other tools/language will have the same problem. Or is there any other workaround on that?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions