Defining Tag of Swagger Operations

When generate Swagger REST API by default they will organized under the default category. You can group your Swagger operations this by defining tags in model. To do this:

  1. Right click on REST Service element in your class diagram and select Open Specification form popup menu.

    Open specification dialog for REST Service

    Open specification dialog for REST Service

  2. Switch to Tag tab. In case the tab is not showing you can then press the black triangle icon at the top right of the dialog to open it.

    Switch to Tag tab

    Switch to Tag tab

  3. Press the Add button at the bottom of the Tag tab.

    Add a tag

    Add a tag

  4. Define the details of the tag, then press OK confirm the change.

    Define details for the tag

    Define details for the tag

  5. Close the specification dialog of REST Service by pressing OK button.

Now when generate Swagger your operations will organized according to the tags.

Resulting swagger document

Resulting swagger document

 

Related Know-how

Related Links

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply