11
votes

i'm trying to use swagger-codegen-maven-plugin to generate my interface . after compiling with the plugin - it generates all the files correctly but for some reason the interface name is DefaultApi.

i looked for some configuration that i can change the name of the interface that been generated but didnt find the solution for that.

any idea on that??

1

1 Answers

14
votes

"DefaultApi" is used when there's no tags specified for the endpoint.

For example, this endpoint will be put in a class named "UserApi" since the tags is set to User.

You will need to update the spec to include proper tags for endpoints to avoid using "DefaultApi"

UPDATE: On May 2018, about 50 top contributors and template creators of Swagger Codegen decided to fork Swagger Codegen to maintain a community-driven version called OpenAPI Generator. Please refer to the Q&A for more information.