When I create an API with swagger, normaly my API has the name of the resource:
Tasks
/tasks
/tasks/{id}
etc.
Sometimes I only get a default:
Default
GET /tasks
GET /tasks/{uuid}
etc.
What determines the header name of the API generated?
Screenshot of wished behaviour (tasks is sometimes default):

Do you mean these headers in Swagger UI?

They are generated based on the tags of your API operations. For example, to group operations under "Tasks", use:
{
...
"paths": {
"\/tasks:": {
"tags": [
"Tasks"
],
...
Each operation can have any number of tags. Operations with no tags will be listed under the "Default" group.
To provide description for the tags, use the top-level tags section:
{
...
"tags": [
{
"name": "Tasks",
"description": "Operations to manage tasks"
}
},
{
"name": "Notes",
"description": "Operations to manage notes"
}
}
],
...
This depends on what you have passed on as an argument to swagger's Api annotation (io.swagger.annotations.Api) at the top of your RESTful service implementation -
@Path(value="/")
@Api(value="/")
public interface YourService {
....
}
@Api(value="/") will generate default
@Api(value="/Tasks") will generate Tasks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With