The paths section defines individual endpoints (paths) in your API, and the HTTP methods (operations) supported by these endpoints. For more information, see API Server and Base Path. In the example above, /users means or, depending on the server used. servers:Īll API paths are relative to the server URL. You can define one or several servers, such as production and sandbox. The servers section specifies the API server and base URL. info also supports other keywords for contact information, license, terms of service, and other details. You can use semantic versioning like, or an arbitrary string like 1.0-beta or. version is an arbitrary string that specifies the version of your API (do not confuse it with file revision or the openapi version). HTML is supported to the extent provided by CommonMark (see HTML Blocks in CommonMark 0.27 Specification ). It can be multiline and supports the CommonMark dialect of Markdown for rich text representation. description is extended information about your API. The info section contains API information: title, description (optional), version: info: The available versions are 3.0.0, 3.0.1, 3.0.2, and 3.0.3 they are functionally the same. OpenAPI 3.0 uses semantic versioning with a three-part version number. The OpenAPI version defines the overall structure of an API definition – what you can document and how you document it. MetadataĮvery API definition must include the version of the OpenAPI Specification that this definition is based on: openapi: 3.0.0 Internal staging server for testingĭescription: Optional extended description in CommonMark or HTML.Īll keyword names are case-sensitive. Main (production) serverĭescription: Optional server description, e.g. A sample OpenAPI 3.0 definition written in YAML looks like: openapi: 3.0.0ĭescription: Optional multiline or single-line description in () or HTML.ĭescription: Optional server description, e.g. In this guide, we use only YAML examples but JSON works equally well. You can write OpenAPI definitions in YAML or JSON. OAS 3 This page is about OpenAPI 3.0. If you use OpenAPI 2.0, visit OpenAPI 2.0 pages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |