Overview of the Swagger JSON File

The swagger.json file is a specification file that describes the REST APIs in accordance with the Swagger specification. The file describes details such as available endpoints, operations on each endpoint, input and output parameters for each operation, authentication methods, and other information.

The swagger.json file can be written in YAML or JSON.

For a sample file, see Sample swagger.json File.

Basic Structure of File

For more information on the basic structure of the swagger.json file, refer to http://docs.swagger.io/spec.html#52-api-declaration.

The Swagger representation can be specified in a single file or split into separate files, at your discretion. If it is split across files, you can use $ref fields in the specification to reference parts in different files. For more information on the $ref field, refer to https://swagger.io/docs/specification/using-ref.

Required Fields

For a complete list of all the objects and fields that can be defined in the swagger.json file, refer to https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#specification.