Swagger - Security

Here, Security means authentication and authorization. 

- Authentication means to validate the user through their username and password. 

- The authorization means allowing the user to access the data.

The security can be set in the following ways:

  • None: Here, None means that no security is set to access the API.
  • Basic Auth: It means that the username and password are set for each request.
  • API Key: The key is set to access the API.
  • OATH: It is an authorization scheme.

Description :-

The OAS file or API file contains the human-readable description of elements that generates the documentation automatically. 

In other words, we can say that a description section is added for the API, for each operation which is a combination of path and method, for each parameter, and for each response element.