Stereotypes of the Swagger profile
The Swagger profile contains stereotypes that you can apply to model Representational
State Transfer (REST) elements such as application, resource classes, and resource
methods.
To use these stereotypes, the Swagger profile must be applied to your UML model. If you use
the stereotypes in the Swagger profile, you must also apply the REST profile to the model; the
Swagger stereotypes and type library extend the REST profile and type library.
The following table
lists the stereotypes that you can apply to elements in a model on which the Swagger profile is
applied. In some cases since the Swagger stereotypes extend REST stereotypes, the REST stereotype
must also be applied with it.
| Stereotype | Applicable UML element Required | Stereotype from REST Profile | Comments |
|---|---|---|---|
| «SwaggerApp» | Class | «Application» | Represents a Swagger Object (root document object) |
| «SwaggerOperation» | Operation | «GET» «PUT» «POST» «DELETE» «HEAD» «PATCH» «OPTIONS» |
Represents a Swagger Operation Object |
| «SwaggerParam» | Parameter | «Param» | Represents a Swagger Parameter Object |
| «SwaggerResponse» | Parameter | - | Represents a Swagger Response Object |
| «SwaggerDefinition» | Class | - | Represents a Swagger schema object |
| «SwaggerPrimitiveDefinition» | Class | - | Represents a Swagger schema object of primitive type |
| «SwaggerProperty» | Property | - | Represents a Property of a Swagger schema object |
| «SwaggerHeader» | Property | - | Represents a Swagger Header object |
| «SwaggerTag» | Class | - | Represents a Swagger Tag object |
| «SwaggerSecurityBasic» | Class | - | Represents a Swagger Basic Security schema object |
| «SwaggerSecurityApiKey» | Class | - | Represents a Swagger API Key Security schema object |
| «SwaggerSecurityOAuth2» | Class | - | Represents a Swagger OAuth2 Security schema object |