diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..a252d3d74c
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+*.md linguist-detectable
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000000..baf749a51a
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,11 @@
+# Global Repo Owners
+* @oai/openapi-maintainers @oai/tsc
+
+# Specification Versions
+/versions/ @oai/tsc
+
+# Protect specific top level files
+/MAINTAINERS.md @oai/tsc
+/TOB.md @oai/tsc
+/GOVERNANCE.md @oai/tsc
+/LICENSE @oai/tsc
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..db8d5d8436
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,28 @@
+blank_issues_enabled: false
+
+# The local issue filing links are included in "contact_links" because
+# GitHub's regular issue template mechanism forces the local issue
+# links to be first in the list, when we want them to be last so
+# visitors can be routed to other repos when appropriate.
+contact_links:
+ - name: Have a question about using OpenAPI?
+ url: https://communityinviter.com/apps/open-api/openapi
+ about: Ask us on our Slack!
+ - name: Have a question about OpenAPI Tooling?
+ url: https://tools.openapis.org/
+ about: Please ask your tooling vendor!
+ - name: Want to add to our list of OpenAPI Tools?
+ url: https://tools.openapis.org/
+ about: Please take a look at our tooling site's instructions!
+ - name: Want to suggest more how-to documentation and examples?
+ url: https://github.com/OAI/learn.openapis.org/issues/new
+ about: Please open an issue on our learning site!
+ - name: Want to add to the registries at spec.openapis.org/registry ?
+ url: https://github.com/OAI/OpenAPI-Specification/issues/new
+ about: Please open an issue in this repository!
+ - name: Want to report an error in the specification?
+ url: https://github.com/OAI/OpenAPI-Specification/issues/new
+ about: Please open an issue in this repository!
+ - name: Want to request a new feature in the specification?
+ url: https://github.com/OAI/OpenAPI-Specification/discussions/new?category=enhancements
+ about: Please start a discussion in this repository!
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000..ae17f3da25
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,12 @@
+version: 2
+updates:
+- package-ecosystem: github-actions
+ directory: "/"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
+- package-ecosystem: npm
+ directory: "/"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000000..43847f00ae
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,16 @@
+
diff --git a/.github/templates/agenda.md b/.github/templates/agenda.md
new file mode 100644
index 0000000000..0b65e594ab
--- /dev/null
+++ b/.github/templates/agenda.md
@@ -0,0 +1,36 @@
+## Weekly meetings happen on Thursdays at 9am - 10am Pacific
+
+This agenda gives visibility into discussion topics for the weekly Technical Developer Community (TDC) meetings. Sharing agenda items in advance allows people to plan to attend meetings where they have an interest in specific topics.
+
+Whether attending or not, **anyone can comment on this issue prior to the meeting to suggest topics or to add comments on planned topics or proposals**.
+
+Meetings take place over Zoom: [https://zoom.us/j/975841675](https://zoom.us/j/975841675?pwd=SUh4MjRLaEFKNlI3RElpWTdhRDVVUT09), dial-in passcode: 763054
+
+### Accessibility & Etiquette
+* Participants must abide by our [Code-of-Conduct](https://github.com/OAI/OpenAPI-Specification/blob/main/CODE_OF_CONDUCT.md#code-of-conduct).
+
+* Meetings are recorded for future reference, and for those who are not able to attend in-person.
+
+* We invite you to feel comfortable to challenge any language or behaviour that is harmful or not inclusive during this meeting.
+
+* We look forward to your participation, but please consider these acts of etiquette:
+ * Remain on mute when not speaking to prevent interruptions.
+ * Blur your background to reduce visual distractions.
+ * Use the Zoom meeting "Raise Hand" feature to notify the group when you wish to speak.
+
+| Blur My Background | Raise Hand |
+|-|-|
+| | |
+
+### Agenda Structure
+
+| Topic | Owner | Decision/NextStep |
+|-|-|-|
+Intros and governance meta-topics (5 mins) | TDC | |
+Reports from Special Interest Groups (5 mins) | SIG members | |
+Any other business (add comments below to suggest topics) | TDC | |
+[Approved spec PRs](https://github.com/OAI/OpenAPI-Specification/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved) | @OAI/tsc | |
+[Active Projects](https://github.com/OAI/OpenAPI-Specification/projects?query=is%3Aopen) | @OAI/openapi-maintainers | |
+[New issues needing attention](https://github.com/search?q=repo%3Aoai%2Fopenapi-specification+is%3Aissue+comments%3A0+no%3Alabel+is%3Aopen) | @OAI/triage | |
+
+/cc [@OAI/tsc](https://github.com/orgs/OAI/teams/tsc) please suggest items for inclusion.
diff --git a/.github/workflows/agenda.yaml b/.github/workflows/agenda.yaml
new file mode 100644
index 0000000000..88b9be8391
--- /dev/null
+++ b/.github/workflows/agenda.yaml
@@ -0,0 +1,47 @@
+name: agenda
+
+# author: @MikeRalphson
+# issue: various
+
+#
+# This workflow creates the agenda issue each week. It runs on a cron every
+# Monday morning, raising an issue for the following Thursday.
+# It can also be run manually, in case GitHub Actions has a failure.
+#
+
+on:
+ schedule:
+ - cron: '0 16 * * 4'
+ workflow_dispatch: {}
+
+permissions:
+ issues: write
+ contents: read
+
+jobs:
+ agenda:
+ if: github.repository == 'OAI/OpenAPI-Specification'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TITLE_PREFIX: "Open Community (TDC) Meeting, "
+ LABEL: "Housekeeping"
+ POST_MEETING_CLOSE_DURATION_IN_DAYS: 10
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4 # checkout repo content
+
+ # we want to close old agenda issues before creating a new one because there's a limit of 3 pinned items on a repo
+ - name: Close old agenda issues
+ run: gh issue list -l ${{ env.LABEL }} --author "app/github-actions" --json number,title | ConvertFrom-Json | Where-Object { $_.title -like "${{ env.TITLE_PREFIX }}*" -and ([datetime]::UtcNow - [datetime]::Parse([regex]::Replace($_.title.Replace("${{ env.TITLE_PREFIX }}", ""), "\([^)]+\)", ""))) -ge [timespan]::FromDays([int]::Parse("${{ env.POST_MEETING_CLOSE_DURATION_IN_DAYS }}"))} | ForEach-Object { gh issue close $_.number && gh issue unpin $_.number }
+ shell: pwsh
+
+ - name: Create agenda issue
+ run: |
+ $nextThursday = @(@(1..8) | % {$(Get-Date).AddDays($_)} | ? {$_.DayOfWeek -ieq "Thursday"})[0].ToString("dddd dd MMMM yyyy", [CultureInfo]::InvariantCulture)
+ $result = gh issue create -l ${{ env.LABEL }} -t "${{ env.TITLE_PREFIX }}$nextThursday" -F .github/templates/agenda.md
+ gh issue pin $result
+ shell: pwsh
+
+
diff --git a/.github/workflows/convert-examples-to-json.yaml b/.github/workflows/convert-examples-to-json.yaml
new file mode 100644
index 0000000000..d1b9768275
--- /dev/null
+++ b/.github/workflows/convert-examples-to-json.yaml
@@ -0,0 +1,53 @@
+name: convert-examples-to-json
+
+# author: @MikeRalphson / @cebe
+# issue: https://github.com/OAI/OpenAPI-Specification/issues/1385
+
+#
+# This workflow updates the *.json files in the examples/v3.x directories,
+# when the corresponding *.yaml files change.
+# JSON example files are automatically generated from the YAML example files.
+# Only the YAML files should be adjusted manually.
+#
+
+# run this on push to main
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ yaml2json:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2 # checkout repo content
+
+ - uses: actions/setup-node@v4 # setup Node.js
+ with:
+ node-version: '20.x'
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: convert YAML examples to JSON
+ run: find examples/v3* -type f -name "*.yaml" | xargs node scripts/yaml2json/yaml2json.js
+
+ - name: git diff
+ run: |
+ git add examples/**/*.json
+ git --no-pager -c color.diff=always diff --staged
+
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v5
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ branch: update-json-examples
+ title: Update JSON example files
+ commit-message: Update JSON example files
+ body: |
+ This pull request is automatically triggered by GitHub action `convert-examples-to-json`.
+
+ The examples/v3.* YAML files have changed, so the JSON files are automatically being recreated.
+
diff --git a/.github/workflows/inactive-issues.yml b/.github/workflows/inactive-issues.yml
new file mode 100644
index 0000000000..06b3c028bd
--- /dev/null
+++ b/.github/workflows/inactive-issues.yml
@@ -0,0 +1,36 @@
+on:
+ issues:
+ types: labeled
+ workflow_dispatch:
+ schedule:
+ - cron: '*/5 * * * *'
+
+permissions:
+ issues: write
+ contents: read
+
+name: Label and close issues with no recent activity
+
+env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NEEDS_ATTENTION_LABEL: "Needs attention"
+ NEEDS_AUTHOR_FEEDBACK_LABEL: "Needs author feedback"
+ NO_RECENT_ACTIVITY_LABEL: "No recent activity"
+ NO_RECENT_ACTIVITY_DURATION_IN_DAYS: 7
+ NO_RECENT_ACTIVITY_DURATION_CLOSE_IN_DAYS: 28
+ ORG_NAME: ${{ github.repository_owner }}
+ REPO_NAME: ${{ github.event.repository.name }}
+ NO_RECENT_ACTIVITY_COMMENT: "This issue has been labeled with `No recent activity` because there has been no recent activity. It will be closed if no further activity occurs within 28 days. Please re-open this issue or open a new one after this delay if you need to."
+
+
+jobs:
+ run:
+ if: github.repository == 'OAI/OpenAPI-Specification'
+ runs-on: ubuntu-latest
+ name: Label issues with no recent activity
+ steps:
+ - uses: actions/checkout@v4
+ - run: scripts/label-no-recent.ps1
+ shell: pwsh
+ - run: scripts/close-no-recent.ps1
+ shell: pwsh
diff --git a/.github/workflows/respec.yaml b/.github/workflows/respec.yaml
new file mode 100644
index 0000000000..93749656a0
--- /dev/null
+++ b/.github/workflows/respec.yaml
@@ -0,0 +1,61 @@
+name: respec
+
+# author: @MikeRalphson
+# issue: https://github.com/OAI/OpenAPI-Specification/issues/1564
+
+#
+# This workflow updates the respec 'pretty' rendered versions of the spec
+# on the gh-pages branch when the corresponding markdown files change.
+#
+
+# run this on push to main
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch: {}
+
+jobs:
+ respec:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4 # checkout main branch
+ with:
+ fetch-depth: 0
+
+ - uses: actions/setup-node@v4 # setup Node.js
+ with:
+ node-version: '20.x'
+
+ - name: Install dependencies
+ run: npm ci
+
+ - uses: actions/checkout@v4 # checkout gh-pages branch
+ with:
+ ref: gh-pages
+ path: deploy
+
+ - name: run main script
+ run: scripts/md2html/build.sh
+
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v6
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ branch: update-respec-version
+ base: gh-pages
+ delete-branch: true
+ path: deploy
+ labels: Housekeeping
+ reviewers: webron,darrelmiller
+ title: Update ReSpec versions
+ commit-message: Update ReSpec versions
+ signoff: true
+ body: |
+ This pull request is automatically triggered by GitHub action `respec`.
+
+ The versions/v*.md files have changed, so the HTML files are automatically being regenerated.
+
+
diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml
new file mode 100644
index 0000000000..b0f67019d7
--- /dev/null
+++ b/.github/workflows/schema-tests.yaml
@@ -0,0 +1,35 @@
+name: schema-test
+
+# Author: @MikeRalphson / runs @jdesrosiers tests
+# Issue: https://github.com/OAI/OpenAPI-Specification/pull/2489
+
+#
+# This workflow runs the npm test script to validate passing and failing
+# testcases for the metaschema.
+#
+
+# run this on push to any branch and creation of pull-requests
+on:
+ push: {}
+ pull_request: {}
+ workflow_dispatch: {}
+
+jobs:
+ test:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4 # checkout repo content
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-node@v4 # setup Node.js
+ with:
+ node-version: '20.x'
+ - name: Install dependencies from main
+ run: |
+ git checkout remotes/origin/main -- package.json package-lock.json
+ npm ci
+ - name: Run tests
+ run: npm run test
+
diff --git a/.github/workflows/validate-markdown.yaml b/.github/workflows/validate-markdown.yaml
new file mode 100644
index 0000000000..43050e4870
--- /dev/null
+++ b/.github/workflows/validate-markdown.yaml
@@ -0,0 +1,32 @@
+name: validate-markdown
+
+# Author: @MikeRalphson
+# Issue: https://github.com/OAI/OpenAPI-Specification/issues/2130
+
+#
+# This workflow validates files in the versions directory matching 3.*.md
+# Versions before 3.0 are not validated, as they contain linking errors
+# where it is not currently planned to go back and fix them
+#
+
+# run this on push to any branch and creation of pull-requests
+on: [push, pull_request]
+
+jobs:
+ mdv:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4 # checkout repo content
+ with:
+ fetch-depth: 0
+ - name: use the javascript environment from main
+ run: |
+ git checkout remotes/origin/main -- package.json package-lock.json
+ - uses: actions/setup-node@v4 # setup Node.js
+ with:
+ node-version: '20.x'
+ - name: Validate markdown
+ run: npx --yes mdv versions/3.*.md
+
diff --git a/.gitignore b/.gitignore
index 88e134ab28..a19835db8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,6 @@
target
atlassian-ide-plugin.xml
node_modules/
+deploy/
+history
Gemfile.lock
diff --git a/fixtures/v2.0/yaml/.gitkeep b/.gitmodules
similarity index 100%
rename from fixtures/v2.0/yaml/.gitkeep
rename to .gitmodules
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 37727967b9..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-sudo: false
-script:
- - npm install
-env:
- - VALIDATORS=tv4
- - VALIDATORS=zschema
-matrix:
- allow_failures:
- - env: VALIDATORS=tv4
-install:
- - rm -rf ~/.nvm
- - curl -L https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh
- - source ~/.nvm/nvm.sh
- - nvm install 6.1
- - nvm use 6.1
-script:
- - npm install
- - node node_modules/mdv/mdv versions/3.*.md
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000000..a87b404e6d
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,155 @@
+Code of Conduct
+===============
+
+OpenAPI Initiative Code of Conduct
+
+*The Linux Foundation*
+
+*Effective November 24, 2020*
+
+The OpenAPI Initiative (OAI) is an open source Linux Foundation project
+and home of the OpenAPI Specification (OAS) released under the Apache
+2.0 license. As contributors, maintainers, and participants in this
+project, we want to foster an open and welcoming environment. We pledge
+to make participation in our project and our community a harassment-free
+experience for everyone, regardless of age, body size, disability,
+ethnicity, gender identity and expression, level of experience,
+education, socio-economic status, nationality, personal appearance,
+race, religion, or sexual identity and orientation.
+
+Our Standards
+-------------
+
+Examples of behaviors that contribute to creating a positive environment
+include:
+
+- Using welcoming and inclusive language
+
+- Being respectful of differing viewpoints and experiences
+
+- Gracefully accepting constructive criticism
+
+- Focusing on what is best for the community
+
+- Showing empathy towards other community members
+
+- Assuming the best intent from others
+
+Examples of unacceptable behavior by participants include:
+
+- The use of sexualized language or imagery and unwelcome sexual attention or advances
+
+- Making unsolicited, insulting or derogatory comments, including personal (i.e., ad hominem) or political attacks to create conflict (e.g., trolling)
+
+- Public or private harassment
+
+- Publishing others' private information, such as a physical or electronic address, without explicit permission (e.g., doxxing)
+
+- Threatening, offensive, harmful comments, or behavior
+
+- Other conduct which could reasonably be considered inappropriate in a professional setting
+
+Our Responsibilities
+--------------------
+
+The Code of Conduct Committee is responsible for clarifying the
+standards of acceptable behavior and is expected to take appropriate and
+fair corrective action in response to any instances of unacceptable
+behavior.
+
+Scope
+-----
+
+This Code of Conduct applies to OAI project spaces, as well as
+interactions in public spaces. Project spaces include, but are not
+limited to, official OAI code repositories, Slack, mailing lists,
+meetings, and events. Public spaces may include venues where an
+individual is representing the project or its community. Examples of
+this include a community member's email communication, forum posts,
+social media activity, or acting as a representative at an online or
+offline event. In addition, violations of this code of conduct outside
+of these spaces may affect a person's ability to participate in them.
+
+Enforcement
+-----------
+
+To report instances of abuse, harassment, or otherwise unacceptable
+behavior, contact
+[conduct\@openapis.org](mailto:conduct@openapis.org). **We
+are committed to maintaining the confidentiality of anyone reporting an
+incident**. The Code of Conduct Committee will review and investigate
+all complaints, responding as deemed necessary and appropriate to the
+circumstances. For incidents relating to offline events, we aim to
+respond to reports within 24 hours, and for incidents relating to online
+activities, we aim to respond to reports within 7 days.
+
+The Code of Conduct Committee has the right and responsibility to
+remove, edit, or reject comments, commits, code, wiki edits, issues, and
+other contributions that are not aligned to this Code of Conduct, or
+take other appropriate action as deemed necessary for behaviors contrary
+to the standards listed above. In the case of offline or in-person
+events, if a participant engages in behavior that is not aligned to this
+Code of Conduct, the committee may take action, such as warning the
+offender, banning the offender from various online spaces (temporary or
+permanent), removing the offender from an event with no refund, or other
+options deemed appropriate.
+
+Enforcement Guidelines
+----------------------
+
+The Code of Conduct committee will follow these Enforcement Guidelines in
+determining the consequences for any action they deem in violation of this
+Code of Conduct:
+
+#### 1. Correction
+Community Impact: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+Consequence: A private, written warning from the Code of Conduct committee,
+providing clarity around the nature of the violation and an explanation of
+why the behavior was inappropriate. A public apology may be requested.
+
+#### 2. Warning
+Community Impact: A violation through a single incident or series of
+actions.
+
+Consequence: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction
+with the Code of Conduct committee, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external
+channels like social media. Violating these terms may lead to a temporary
+or permanent ban.
+
+#### 3. Temporary Ban
+Community Impact: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+Consequence: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No
+public or private interaction with the people involved, including
+unsolicited interaction with the Code of Conduct committee, is allowed
+during this period. Violating these terms may lead to a permanent ban.
+
+#### 4. Permanent Ban
+Community Impact: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of
+an individual, or aggression toward or disparagement of classes of
+individuals.
+
+Consequence: A permanent ban from any sort of public interaction
+within the community.
+
+### Events
+
+Some OpenAPI events are governed by the [Linux Foundation Code of
+Conduct](https://events.linuxfoundation.org/about/code-of-conduct/)
+(E.g. API Specifications Conference) and will be listed on the event
+page. The OAI Code of Conduct is designed to be compatible with the
+above policy and also includes more details on responding to incidents.
+
+### Attribution
+
+This code of conduct is adapted from the [Contributor Covenant, version
+1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct)
+and the [PyCon 2019 Code of
+Conduct](https://us.pycon.org/2019/about/code-of-conduct/).
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index d5f6fff76b..5a8598328d 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -1,51 +1,165 @@
## Development Guidelines
-This document intends to establish guidelines which build a transparent, open mechanism for deciding how to evolve the OpenAPI Specification. The Open API Technical Contributor Board will initially follow these processes when merging changes from external contributors or from the TCB itself. This guideline document will be adjusted as practicality dictates.
+This document intends to establish guidelines which build a transparent, open mechanism for deciding how to evolve the OpenAPI Specification. The OpenAPI Technical Steering Committee (TSC) will initially follow these processes when merging changes from external contributors or from the TSC itself. This guideline document will be adjusted as practicality dictates.
+
+### Essential Policies
+
+If in doubt about a policy, please [ask on our Slack](https://communityinviter.com/apps/open-api/openapi) before opening a PR.
+
+#### No changes to published specifications
+
+No changes, ***no matter how trivial***, are ever made to the contents of published specifications. The only potential changes to those documents are updates to link URLs _if and only if_ the targeted document is moved by a 3rd party. Other changes to link URLs are not allowed.
+
+#### Current branches and documents open to change
+
+The first PR for a change should be against the oldest release line to which it applies. Changes can then be forward-ported as appropriate.
+
+The current (February 2024) active releases are:
+
+| Version | Branch | File |
+| ------- | ------ | ---- |
+| 3.0.4 | `v3.0.4-dev` | `versions/3.0.4.md` |
+| 3.1.1 | `v3.1.1-dev` | `versions/3.1.1.md` |
+| 3.2.0 | `v3.2.0-dev` | `versions/3.2.0.md` |
+| 4.0.0 | [OAI/sig-moonwalk](https://github.com/OAI/sig-moonwalk) | [discussions only](https://github.com/OAI/sig-moonwalk/discussions) |
+
+#### Changing the schemas
+
+Schemas are only changed _after_ the specification is changed. Changes are made on the `main` branch, and should be made to the YAML version _only_. The JSON version will be generated automatically.
## OAI Specification Driving factors
-The OpenAPI Specification should be use-case driven. We can specify support for hypothetical use cases as we see fit, but specifications should be backed by realistic scenarios.
+The OpenAPI Specification should be use-case driven. We can specify support for hypothetical use cases as we see fit, but specifications should be backed by realistic scenarios.
## Specification Change Criteria
-The specification _will change_ from the original 2.0 version. We should typically make changes when any of the following criteria are met:
+The specification *will evolve over time*. Changes may be made when any of the following criteria are met:
+
+* Clarity. The current "way" something is done doesn't make sense, is complicated, or not clear.
+
+* Consistency. A portion of the specification is not consistent with the rest, or with the industry standard terminology.
+
+* Necessary functionality. We are missing functionality because of a certain design of the specification.
+
+* Forward-looking designs. As usage of APIs evolves to new protocols, formats, and patterns, we should always consider what the next important functionality should be.
+
+* Impact. A change will provide impact on a large number of use cases. We should not be forced to accommodate every use case. We should strive to make the *common* and *important* use cases both well supported and common in the definition of the OAI Spec. We cannot be edge-case driven.
+
+## Specification Change Process
+
+For each change in the specification we should *always* consider the following:
+
+* Migration. Is this a construct that has a path from the [existing specification](https://github.com/OAI/OpenAPI-Specification/releases)? If so, how complicated is it to migrate to the proposed change?
+
+* Tooling. Strive to support code generation, software interfaces, spec generation techniques, as well as other utilities. Some features may be impossible to support in different frameworks/languages. These should be documented and considered during the change approval process.
+
+* Visualization. Can the specification change be graphically visualized somehow in a UI or other interface?
+
+Spec changes should be approved by a majority of the committers. Approval can be given by commenting on the issue itself, for example, "Approved by @webron" however at least one formal GitHub-based flow approval must be given. After voting criteria is met, any committer can merge the PR. No change should be approved until there is documentation for it, supplied in an accompanying PR.
+
+### Proposals for Specification Changes
+
+As an organisation, we're open to changes, and these can be proposed by anyone.
+The specification is very widely adopted, and there is an appropriately high bar for wide appeal and due scrutiny as a result.
+We do not accept changes lightly (but we will consider any that we can).
+
+Small changes are welcome as pull requests.
+
+Bigger changes require a more formal process.
+
+1. Start a [discussion](https://github.com/OAI/OpenAPI-Specification/discussions) of type "Enhancements".
+ The discussion entry must include some use cases, your proposed solution and the alternatives you have considered.
+ If there is engagement and support for the proposal over time, then it can be considered as a candidate to move to the next stage.
+
+2. It really helps to see the proposed change in action.
+ Start using it as a `x-*` extension if that's appropriate, or try to bring other evidence of your proposed solution being adopted.
+
+3. If you are adding support for something from another specification (such as OAuth), please point to implementations of that
+ specification so that we can understand how, and to what degree, it is being used.
- - Clarity. The current "way" something is done doesn't make sense, is complicated, or not clear.
- - Consistency. A portion of the specification is not consistent with the rest, or with the industry standard terminology.
- - Necessary functionality. We are missing functionality because of a certain design of the specification.
- - Forward-looking designs. As usage of APIs evolves to new protocols, formats, and patterns, we should always consider what the next important functionality should be.
- - Impact. A change will provide impact on a large number of use cases. We should not be forced to accommodate every use case. We should strive to make the _common_ and _important_ use cases both well supported and common in the definition of the OAI Spec. We cannot be edge-case driven.
+4. If the suggested change has good support, you will be asked to create a formal proposal.
+ Use the [template in the proposals directory](https://github.com/OAI/OpenAPI-Specification/tree/main/proposals), copy it to a new file, and complete it.
+ Once you the document is ready, open a pull request.
+5. The proposal will be more closely reviewed and commented on or amended until it is either rejected or accepted.
+ At that point, the proposal is merged to the `main` branch and a final pull request is opened to add the feature to the appropriate version of the specification.
+
+Questions are welcome on the process and at any time. Use the discussions feature or find us in Slack.
## Tracking Process
- - Use GitHub for all spec designs, use cases, and so on.
- - As with 2.0, the **human readable** document is the source of truth. If using a JSON Schema again to document the spec, it is secondary to the human documentation. The documentation should live in a *.md file, in parallel to the 2.0 document (versions/3.0.0.md for example).
- - The `master` branch shall remain the current, released OpenAPI Specification (i.e., 2.0). We will work in an OpenAPI.next branch, which shall be described and linked to on the **default** README.md on master.
- - Examples of how something is described _currently_ vs. the proposed solution should accompany any change proposal.
- - New features should be done in feature branches which, upon approval, are merged into the OpenAPI.next branch.
- - Use labels for the workflow of specification changes. Examples of labels are `proposed`, `needs migration review`, `needs tooling review`, `needs documentation`, `rejected`, and `needs approval`. These labels must be assigned by project committers.
- - An issue will be opened for each feature change. Embedded in the issue, or ideally linked in a file via pull-request (PR), a document about use cases should be supplied with the change.
- - A PR will be used to describe the _proposed_ solution, and linked to the original issue.
- - Not all committers will contribute to every single proposed change. There may be many open proposals at once, and multiple efforts may happen in parallel.
- - When the OpenApi.next spec is complete and approved for release, the branch will be merged to master.
+* GitHub is the medium of record for all spec designs, use cases, and so on.
+
+* The **human readable** document is the source of truth. If using a JSON Schema again to document the spec, it is secondary to the human documentation. The documentation should live in a *.md file, in parallel to the latest document (versions/3.0.0.md for example).
+
+* At any given time, there would be *at most* 4 work branches. The branches would exist if work has started on them. Assuming a current version of 3.0.0:
+
+ * main - Current stable version. No PRs would be accepted directly to modify the specification. PRs against supporting files can be accepted.
+
+ * v3.0.1-dev - The next PATCH version of the specification. This would include non-breaking changes such as typo fixes, document fixes, wording clarifications.
+
+ * v3.1.0 - The next MINOR version.
+
+ * v4.0.0 - The next MAJOR version.
+
+* The main branch shall remain the current, released OpenAPI Specification. We will describe and link the work branch(es) on the **default** README.md on main.
+
+* Examples of how something is described *currently* vs. the proposed solution should accompany any change proposal.
+
+* New features should be done in feature branches/forks which, upon approval, are merged into the proper work branch.
+
+* Use labels for the workflow of specification changes. Examples of labels are proposed, housekeeping, migration-review, tooling-, needs documentation, review (candidate for upcoming TSC mtg), rejected, and needs approval. These labels must be assigned by project committers. Style is lowercase with dashes in place of spaces.
+
+* An issue will be opened for each feature change. Embedded in the issue, or ideally linked in a file via pull-request (PR), a document about use cases should be supplied with the change.
+
+* A PR will be used to describe the *proposed* solution and linked to the original issue.
+
+* Not all committers will contribute to every single proposed change. There may be many open proposals at once, and multiple efforts may happen in parallel.
-## Approving Changes
+* When the work branch is ready and approved, the branch will be merged to main.
-For each change in the specification we should _always_ consider the following:
+## Release Process
- - Migration. Is this a construct that has a path from the existing 2.0 specification? If so, how complicated is it to migrate to the proposed change?
- - Tooling. Strive to support code generation, software interfaces, and spec generation techniques. Some features may be impossible to support in different frameworks/languages. These should be documented and considered during the change approval process.
- - Visualization. Can the specification change be graphically visualized somehow in a UI or other interface?
+A release requires a vote on the release notes by TSC members within the voting period. Major or minor release voting periods will be announced by the Liaison in the Slack channel and noted on the calendar at least 6 days in advance. During this time, TSC members who have not yet voted must note their approval on the GitHub pull request for the release notes. Patch releases happen at the first TSC meeting of a calendar month. The Liaison is responsible for coordinating the actual merge to main with marketing support, if any.
-Spec changes should be approved by a majority of the committers. Approval can be given by commenting on the issue itself, for example, "Approved by @fehguy". After voting criteria is met, any committer can merge the PR. (**TODO**: we will want to formalize what voting criteria actually is).
+* Patch-level releases require majority approval by TSC members. (Max voting period 3 days)
-No change should be approved until there is documentation for it, supplied in an accompanying PR.
+* Minor: requires approval by 66% of TSC members. (Max voting period 7 days)
+
+* Major: requires approval by 66% of TSC members. (Max voting period 14 days)
## Transparency
-We should always be as transparent as possible. Sometimes there will be discussions that use customer names, sensitive use cases, and so on. These must be anonymized, discussed in a private repository, or conducted offline.
+The process should be as transparent as possible. Sometimes there will be discussions that use customer names, sensitive use cases, and so on. These must be anonymized, discussed in a private repository, or conducted offline. General discussions should happen on the GitHub issues for this project.
+
+## Automated closure of issues Process
+
+In an effort to keep the list of issues up to date and easier to navigate through, issues get closed automatically when they become inactive.
+
+This process makes use of the following labels:
+
+* Needs author feedback: the issue has been replied to by the triage team and is awaiting a follow up from the issue's author. This label needs to be added manually by people doing triage/experts whenever they reply. It's removed automatically by the workflow.
+* No recent activity: the issue hasn't received a reply from its author within the last 10 days since `Needs author feedback` was added and will be closed within 28 days if the author doesn't follow up. This label is added/removed automatically by the workflow.
+* Needs attention: The issue's author has replied since the `Needs author feedback` label was set and the triage team will reply as soon as possible. This label needs to be removed manually by people doing triage/experts whenever they reply. It's added automatically by the workflow.
+
+## Automated TDC agenda issues Process
+
+An issue is opened every week, 7 days in advance, for the Technical Direction Committee (TDC), it provides the information to connect the the meeting, and serves as a placeholder to build the agenda for the meeting. Anyone is welcome to attend the meeting, or to add items to the agenda as long as they plan on attending to present the item. These issues are also automatically pinned for visibility and labeled with "Housekeeping".
+
+Ten (10) days after the meeting date is passed (date in the title of the issue), it gets closed and unpinned automatically.
+
+## Participation
+
+While governance of the specification is the role of the TSC, the evolution of the specification happens through the participation of members of the developer community at large. Any person willing to contribute to the effort is welcome, and contributions may include filing or participating in issues, creating pull requests, or helping others with such activities.
+
+## Community Roles
+
+While these developer community roles are informal, there are many ways to get involved with the OpenAPI community, such as:
+
+* Contributor: Includes but is not limited to any [contributor to the specification](https://github.com/OAI/OpenAPI-Specification/graphs/contributors) via an accepted pull request or who participates in issues or TSC calls.
+
+* Implementer: any person involved in the creation or maintenance of tooling that leverages the current OpenAPI Specification
- - Asynchronous discussions should live in the GitHub issues for this project.
- - Realtime discussions should be in a public chat such as IRC or Slack.
+* Ambassador: represents the OpenAPI Specification to the developer community. This could be through talks at conferences or meetups, blog posts, or answering questions in places like Twitter, Stack Overflow, or the GitHub repo.
+* Supporter: uses the specification and appreciates its value.
diff --git a/GOVERNANCE.md b/GOVERNANCE.md
new file mode 100644
index 0000000000..2537ade5c3
--- /dev/null
+++ b/GOVERNANCE.md
@@ -0,0 +1,33 @@
+# Governance
+
+The OpenAPI Specification is a project of the OpenAPI Initiative (OAI), under the auspices of the Linux Foundation. For governance of the OAI, review the [OAI's charter](https://www.openapis.org/participate/how-to-contribute/governance).
+
+# Processes and procedures of the Technical Steering Committee (TSC)
+
+The TSC is a self-organizing sub-group of the OAI. Herein are its principles and guidelines.
+
+## 1. The establishment of roles and the responsibilities for each role
+
+Roles:
+
+* [Liaison](https://www.merriam-webster.com/dictionary/liaison) — Elected by TSC members in a plurality vote (oral count). Liaison represents the TSC to the OAI's Business Governing Board (BGB) at board meetings (though this itself does not confer voting rights) and is the public facing mouthpiece of the TSC.
+
+* [Maintainer](https://www.merriam-webster.com/dictionary/maintainer) — all and only members of the TSC are maintainers, and are responsible for approving proposed changes to the specification. If membership drops below 3, work is suspended until the BGB can re-establish the minimum. To maintain agility, the TSC should be capped at a maximum 9 members, though that number can be reconsidered by the TSC in the future. Past members will be noted as emeritus status once they are no longer members.
+
+* [Community Manager](https://en.wikipedia.org/wiki/Online_community_manager) — responsible for onboarding of new contributors, dealing with antisocial behaviour before it becomes a code of conduct violation, and managing the issue triage team.
+
+* [Rick](https://www.youtube.com/watch?v=dQw4w9WgXcQ) — Responsible for not giving up or letting down. Requires plurality vote of TSC members.
+
+## 2. Adding members to the TSC
+
+A call-for-nominations period may be agreed upon by the TSC voting members and announced in a timely manner on a weekly TDC call (and documented on the agenda issue), assuming the TSC membership is not already at its maximum. A candidate may be nominated through a motion by a voting TSC member in a closed TSC meeting. A nominee must not receive opposition votes of more than 25% of the TSC voting membership via a confidential vote held electronically within a week following the nomination meeting. Approved nominees become provisional members and are expected to comport themselves as full members of the TSC during the provisional period of 6 months. The provisional period is concluded by a second, confidential vote similar to the nomination period's vote, after which newly confirmed members gain their voting rights. At most there are four voting periods per year (no more than one every three months), with a minimum of one per year.
+
+## 3. Removal of membership from the TSC
+
+Occasionally it may be necessary to remove a TSC member, such as behavior that violates the code of conduct or prolonged absenteeism. A 66% vote (confidential, electronic) of the other TSC members is required to remove a member. Otherwise, TSC members are removed when they renounce their position by informing the TSC of their effective resignation date via email.
+
+## 4. Criteria for decisions
+
+The group will strive to achieve all decisions via unopposed consensus. When not possible, unresolved conflicts will be raised to the OAI's Technical Oversight Board (TOB).
+
+The TSC will maintain a publicly available document specifying the process in the contributor guidelines for how proposed changes are merged into the specification. The TSC will document and publicize the schedule of merge parties and release parties for the benefit of the developer community.
diff --git a/IMPLEMENTATIONS.md b/IMPLEMENTATIONS.md
index 773e2595a9..8ee1a8949a 100644
--- a/IMPLEMENTATIONS.md
+++ b/IMPLEMENTATIONS.md
@@ -1,47 +1,9 @@
### Implementations
-Below is a list of known tooling that implements the 3.0.0 specification. Because
-the 3.0.0 specification has not yet been released, refer to the details of projects listed below for any notes about stability and roadmap. The process
-to create the best possible 3.0.0 specification includes feedback from end-users
-and tooling creators. We strongly encourage draft tooling be
-made available for early users of the OAS.
+The list of implementations formerly in this file is no-longer maintained here.
-These tools are not necessarily endorsed by the OAI.
+You may find a more comprehensive list at https://tools.openapis.org
-#### Low-Level tooling
+Instructions on listing your projects are contained in https://github.com/OAI/Tooling#how-can-you-help
-| Title | Project Link | Language |Description |
-|----------------|--------------|----------|---------------------|
-| swagger-parser | [GitHub/swagger-api](https://github.com/swagger-api/swagger-parser/tree/feature/3.0.0-rc0) | Java | Swagger 1.0, 1.1, 1.2, 2.0 to Open API Specification converter |
-| swagger-models | [GitHub/swagger-api](https://github.com/swagger-api/swagger-core/tree/feature/3.0.0-rc0/modules/swagger-models) | Java | Open API 3.0 Java Pojos |
-| KaiZen OpenAPI Parser | [GitHub/RepreZen/KaiZen-OpenAPI-Parser](https://github.com/RepreZen/KaiZen-OpenAPI-Parser) | Java | High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x |
-| openapi3-ts | [GitHub/metadevpro/openapi3-ts](https://github.com/metadevpro/openapi3-ts) | TypeScript | TS Model & utils for OpenAPI 3.0.x contracts |
-| swagger2openapi | [GitHub/mermade/swagger2openapi](https://github.com/mermade/swagger2openapi) | Node.js | An OpenAPI / Swagger 2.0 to OpenAPI 3.0.x converter and validator |
-| Tavis.OpenApi | [GitHub/tavis-sofware/Tavis.OpenApi](https://github.com/tavis-software/Tavis.OpenApi/) | dotnet | C# based parser with definition validation and migration support from V2 |
-
-
-#### Editors
-
-| Title | Project Link | Language |Description |
-|----------------|--------------|----------|---------------------|
-| KaiZen OpenAPI Editor | [GitHub/RepreZen/KaiZen-OpenAPI-Editor](https://github.com/RepreZen/KaiZen-OpenAPI-Editor) | Java | Eclipse Editor for OpenAPI 2.0 and 3.0 |
-| RepreZen API Studio | [RepreZen.com/OpenAPI](https://www.reprezen.com/OpenAPI) | Java | Commercial desktop IDE for API design, documentation & development |
-| OpenApi-gui | [GitHub/Mermade/openapi-gui](https://github.com/Mermade/openapi-gui) | Node.js | GUI / visual editor for creating and editing OpenApi / Swagger definitions |
-
-
-#### User Interfaces
-
-| Title | Project Link | Language |Description |
-|----------------|--------------|----------|---------------------|
-| openapi-viewer | [GitHub/koumoul/openapi-viewer](https://github.com/koumoul-dev/openapi-viewer) | Vue.js | Browse and test a REST API described with the OpenAPI 3.0 Specification. |
-
-
-#### Server Implementations
-
-
-#### Code Generators
-
-| Title | Project Link | Language |Description |
-|----------------|--------------|----------|---------------------|
-| baucis-openapi3 | [Github/metadevpro/baucis-openapi3](https://github.com/metadevpro/baucis-openapi3) | Node.js | [Baucis.js](https://github.com/wprl/baucis) plugin for generating OpenAPI 3.0 compliant API contracts. |
-| Google Gnostic | [GitHub/googleapis/gnostic](https://github.com/googleapis/gnostic) | Go | Compile OpenAPI descriptions into equivalent Protocol Buffer representations. |
+These tools are not endorsed by the OAI.
diff --git a/LICENSE b/LICENSE
index 8d9ebfcb19..23b34fdff2 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,11 +1,201 @@
-Copyright 2017 The Linux Foundation
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright The Linux Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
new file mode 100644
index 0000000000..e84988bb0b
--- /dev/null
+++ b/MAINTAINERS.md
@@ -0,0 +1,17 @@
+## Active
+* Darrel Miller [@darrelmiller](https://github.com/darrelmiller)
+* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc)
+* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh)
+* Ron Ratovsky [@webron](https://github.com/webron)
+
+## Provisional
+* Lorna Mitchell [@lornajane](https://github.com/lornajane)
+* Mike Kistler [@mikekistler](https://github.com/mikekistler)
+* Miguel Quintero [@miqui](https://github.com/miqui)
+* Ralf Handl [@ralfhandl](https://github.com/ralfhandl)
+
+## Emeritus
+* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson)
+* Uri Sarid [@usarid](https://github.com/usarid)
+* Jason Harmon [@jharmn](https://github.com/jharmn)
+* Tony Tam [@fehguy](https://github.com/fehguy)
diff --git a/README.md b/README.md
index 7eaf9ba26d..d296f47b61 100644
--- a/README.md
+++ b/README.md
@@ -1,60 +1,59 @@
# The OpenAPI Specification
-[](https://travis-ci.org/OAI/OpenAPI-Specification)
+ [](https://www.codetriage.com/oai/openapi-specification)

-The OpenAPI Specification is a community driven, open specification within the [Open API Initiative](https://www.openapis.org/), a Linux Foundation Collaborative Project.
-The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for REST APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.
+The OpenAPI Specification is a community-driven open specification within the [OpenAPI Initiative](https://www.openapis.org/), a Linux Foundation Collaborative Project.
-Use cases for machine-readable API definition documents include, but are not limited to, interactive documentation; code generation for documentation, clients, and servers; and automation of test cases. OpenAPI documents describe an API's services and are represented in either YAML or JSON formats. These documents may either be produced and served statically or be generated dynamically from an application.
+The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs. This allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.
-The OpenAPI Specification does not require rewriting existing APIs. It does not require binding any software to a service—the service being described may not even be owned by the creator of its description. It does, however, require the capabilities of the service be described in the structure of the OpenAPI Specification. Not all services can be described by OpenAPI—this specification is not intended to cover every possible style of REST APIs. The OpenAPI Specification does not mandate a specific development process such as design-first or code-first. It does facilitate either technique by establishing clear interactions with a REST API.
+Use cases for machine-readable API definition documents include, but are not limited to: interactive documentation; code generation for documentation, clients, and servers; and automation of test cases. OpenAPI documents describe API services and are represented in YAML or JSON formats. These documents may be produced and served statically or generated dynamically from an application.
-This GitHub project is the starting point for OpenAPI.
-Here you will find the information you need about the OpenAPI Specification, simple examples of what it looks like, and some general information regarding the project.
+The OpenAPI Specification does not require rewriting existing APIs. It does not require binding any software to a service – the described service may not even be owned by the creator of its description. It does, however, require that the service's capabilities be described in the structure of the OpenAPI Specification. Not all services can be described by OpenAPI – this specification is not intended to cover every possible style of HTTP APIs, but does include support for [REST APIs](https://en.wikipedia.org/wiki/Representational_state_transfer). The OpenAPI Specification does not mandate a specific development process such as design-first or code-first. It does facilitate either technique by establishing clear interactions with an HTTP API.
-## Current Version - 3.0
+This GitHub project is the starting point for OpenAPI. Here you will find the information you need about the OpenAPI Specification, simple examples of what it looks like, and some general information regarding the project.
-The current version of the OpenAPI specification is [OpenAPI Specification 3.0](versions/3.0.0.md).
+## Current Version - 3.1.0
+
+The current version of the OpenAPI specification is [OpenAPI Specification 3.1.0](versions/3.1.0.md).
### Previous Versions
-This repository also contains the [OpenAPI Specification 2.0](versions/2.0.md), which is identical to the Swagger 2.0 specification before it was renamed to “OpenAPI Specification”,
-as well as the Swagger 1.2 and Swagger 2.0 specifications.
+This repository also contains all [previous versions](versions).
Each folder in this repository, such as [examples](examples) and [schemas](schemas), should contain folders pertaining to the current and previous versions of the specification.
## See It in Action
-If you just want to see it work, check out the [list of current examples](examples/v3.0).
+If you just want to see it work, check out the [list of current examples](examples).
## Tools and Libraries
Looking to see how you can create your own OpenAPI definition, present it, or otherwise use it? Check out the growing
-[list of 3.0 Implementations](IMPLEMENTATIONS.md).
+[list of implementations](IMPLEMENTATIONS.md).
## Participation
-The current process for development of the OpenAPI Specification is described in
+The current process for developing the OpenAPI Specification is described in
[Development Guidelines](DEVELOPMENT.md).
-Development of the next version of the OpenAPI Specification is guided by the [Technical Developer Community](https://www.openapis.org/participate/how-to-contribute/governance#TDC). This group of committers bring their API expertise, incorporate feedback from the community, and expand the group of committers as appropriate. All development activity on the future specification will be performed as features and merged into this branch. Upon release of the future specification, this branch will be merged to master.
+Developing the next version of the OpenAPI Specification is guided by the [Technical Steering Committee (TSC)](https://www.openapis.org/participate/how-to-contribute/governance#TDC). This group of committers bring their API expertise, incorporate feedback from the community, and expand the group of committers as appropriate. All development activity on the future specification will be performed as features and merged into this branch. Upon release of the future specification, this branch will be merged to `main`.
+
+The TSC holds weekly web conferences to review open pull requests and discuss open issues related to the evolving OpenAPI Specification. Participation in weekly calls and scheduled working sessions is open to the community. You can view the entire OpenAPI [technical meeting calendar](https://calendar.google.com/calendar/u/0/embed?src=c_fue82vsncog6ahhjvuokjo8qsk@group.calendar.google.com) online.
-The Open API Initiative encourages participation from individuals and companies alike.
-If you want to participate in the evolution of the OpenAPI Specification, consider taking the following actions:
+The OpenAPI Initiative encourages participation from individuals and companies alike. If you want to participate in the evolution of the OpenAPI Specification, consider taking the following actions:
-* Review the [current specification](versions/3.0.0.md). The human-readable markdown file _is the source of truth_ for the specification.
+* Review the [current specification](versions/3.1.0.md). The human-readable markdown file _is the source of truth_ for the specification.
* Review the [development](DEVELOPMENT.md) process so you understand how the spec is evolving.
-* Check the [issues](https://github.com/OAI/OpenAPI-Specification/issues) and [pull requests](https://github.com/OAI/OpenAPI-Specification/pulls) to see if someone has already documented your idea or feedback on the specification. You can follow an existing conversation by adding a comment to the existing issue or PR.
+* Check the [issues](https://github.com/OAI/OpenAPI-Specification/issues) and [pull requests](https://github.com/OAI/OpenAPI-Specification/pulls) to see if someone has already documented your idea or feedback on the specification. You can follow an existing conversation by subscribing to the existing issue or PR.
+* Subscribe to an open issue a day (or a week) in your inbox via [CodeTriage.com](https://www.codetriage.com/oai/openapi-specification).
* Create an issue to describe a new concern. If possible, propose a solution.
-Not all feedback can be accommodated and there may be solid arguments for or against a change being appropriate for the specification.
-
-## License
+Not all feedback can be accommodated, and there may be solid arguments for or against a change being appropriate for the specification.
+## Licensing
-See: [License (Apache-2.0)](https://github.com/OAI/OpenAPI-Specification/blob/master/LICENSE)
+See: [License (Apache-2.0)](https://github.com/OAI/OpenAPI-Specification/blob/main/LICENSE)
-
diff --git a/SECURITY_CONSIDERATIONS.md b/SECURITY_CONSIDERATIONS.md
new file mode 100644
index 0000000000..f440033ac4
--- /dev/null
+++ b/SECURITY_CONSIDERATIONS.md
@@ -0,0 +1,25 @@
+# Security Considerations
+
+## OpenAPI Document Formats
+
+OpenAPI documents use JSON, YAML, and JSON Schema, and therefore share their security considerations:
+- [JSON](https://www.iana.org/assignments/media-types/application/json)
+- [YAML](https://www.iana.org/assignments/media-types/application/yaml)
+- [JSON Schema Core](https://json-schema.org/draft/2020-12/json-schema-core#section-13)
+- [JSON Schema Validation](https://json-schema.org/draft/2020-12/json-schema-validation#name-security-considerations)
+
+## Tooling and Usage Scenarios
+
+In addition, OpenAPI documents are processed by a wide variety of tooling for numerous different purposes, such as client code generation, documentation generation, server side routing, and API testing. OpenAPI document authors must consider the risks of the scenarios where the OpenAPI document may be used.
+
+## Security Schemes
+
+An OpenAPI document describes the security schemes used to protect the resources it defines. The security schemes available offer varying degrees of protection. Factors such as the sensitivity of the data and the potential impact of a security breach should guide the selection of security schemes for the API resources. Some security schemes, such as basic auth and OAuth Implicit flow, are supported for compatibility with existing APIs. However, their inclusion in OpenAPI does not constitute an endorsement of their use, particularly for highly sensitive data or operations.
+
+## Handling External Resources
+
+OpenAPI documents may contain references to external resources that may be dereferenced automatically by consuming tools. External resources may be hosted on different domains that may be untrusted. References in an OpenAPI document, or across OpenAPI documents may cause a cycle. Tooling must detect and handle cycles to prevent resource exhaustion.
+
+## Markdown and HTML Sanitization
+
+Certain properties allow the use of Markdown which can contain HTML including script. It is the responsibility of tooling to appropriately sanitize the Markdown.
\ No newline at end of file
diff --git a/SPECIAL_INTEREST_GROUPS.md b/SPECIAL_INTEREST_GROUPS.md
new file mode 100644
index 0000000000..661a757799
--- /dev/null
+++ b/SPECIAL_INTEREST_GROUPS.md
@@ -0,0 +1,5 @@
+# OpenAPI Special Interest Groups (SIGs)
+
+OpenAPI Special Interest Groups, or "SIGs", are the OpenAPI Initiative's way of focusing work in particular areas. SIGs may start with just a Slack channel to gauge interest. SIGs with enough traction to produce work may have their own GitHub repositories and regular Zoom calls, and ultimately produce work that becomes part of, or a companion to, the OpenAPI Specification.
+
+See the [OAS community repository](https://github.com/OAI/community/blob/main/SPECIAL_INTEREST_GROUPS.md) for a complete list of SIGs, and for more information about forming a SIG.
diff --git a/TOB.md b/TOB.md
new file mode 100644
index 0000000000..c40deee81d
--- /dev/null
+++ b/TOB.md
@@ -0,0 +1,21 @@
+# Technical Oversight Board ("TOB")
+
+## Description:
+> The TOB is responsible for managing conflicts, violations of procedures or guidelines or other issues that cannot be resolved in the TSC for the OAS. For further details please consult the OpenAPI Project Charter.
+
+## TSC Elected - terms through May 2023
+Isabelle Mauny @isamauny
+
+Uri Sarid @usarid
+
+Marsh Gardiner @earth2marsh
+
+Ron Ratovsky @webron
+
+## BGB Elected - terms through May 2022
+
+Darrel Miller @darrelmiller
+
+Jerome Louvel @jlouvel
+
+Jeremy Whitlock @whitlockjc
diff --git a/examples/v2.0/json/petstore-expanded.json b/examples/v2.0/json/petstore-expanded.json
index 0c59f9a48e..d5d8de8126 100644
--- a/examples/v2.0/json/petstore-expanded.json
+++ b/examples/v2.0/json/petstore-expanded.json
@@ -7,12 +7,12 @@
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Swagger API Team",
- "email": "foo@example.com",
- "url": "http://madskristensen.net"
+ "email": "apiteam@swagger.io",
+ "url": "http://swagger.io"
},
"license": {
- "name": "MIT",
- "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "petstore.swagger.io",
@@ -207,4 +207,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/examples/v2.0/json/petstore-separate/spec/swagger.json b/examples/v2.0/json/petstore-separate/spec/swagger.json
index 542b76fc2a..7276990020 100644
--- a/examples/v2.0/json/petstore-separate/spec/swagger.json
+++ b/examples/v2.0/json/petstore-separate/spec/swagger.json
@@ -4,18 +4,18 @@
"version": "1.0.0",
"title": "Swagger Petstore",
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
- "termsOfService": "http://helloreverb.com/terms/",
+ "termsOfService": "http://swagger.io/terms/",
"contact": {
- "name": "Wordnik API Team",
- "email": "foo@example.com",
- "url": "http://madskristensen.net"
+ "name": "Swagger API Team",
+ "email": "apiteam@swagger.io",
+ "url": "http://swagger.io"
},
"license": {
- "name": "MIT",
- "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
- "host": "petstore.swagger.wordnik.com",
+ "host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
@@ -143,4 +143,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/examples/v2.0/json/petstore-with-external-docs.json b/examples/v2.0/json/petstore-with-external-docs.json
index 4c5154c233..e9d3f7765d 100644
--- a/examples/v2.0/json/petstore-with-external-docs.json
+++ b/examples/v2.0/json/petstore-with-external-docs.json
@@ -11,8 +11,8 @@
"url": "http://swagger.io"
},
"license": {
- "name": "MIT",
- "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"externalDocs": {
@@ -230,4 +230,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/examples/v2.0/yaml/petstore-expanded.yaml b/examples/v2.0/yaml/petstore-expanded.yaml
index 588759d91a..de93377412 100644
--- a/examples/v2.0/yaml/petstore-expanded.yaml
+++ b/examples/v2.0/yaml/petstore-expanded.yaml
@@ -6,11 +6,11 @@ info:
termsOfService: http://swagger.io/terms/
contact:
name: Swagger API Team
- email: foo@example.com
- url: http://madskristensen.net
+ email: apiteam@swagger.io
+ url: http://swagger.io
license:
- name: MIT
- url: http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
host: petstore.swagger.io
basePath: /api
schemes:
@@ -113,12 +113,14 @@ definitions:
- $ref: '#/definitions/NewPet'
- required:
- id
+ type: "object"
properties:
id:
type: integer
format: int64
NewPet:
+ type: "object"
required:
- name
properties:
@@ -128,6 +130,7 @@ definitions:
type: string
Error:
+ type: "object"
required:
- code
- message
diff --git a/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml b/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml
index 850527ebf6..b937b5022a 100644
--- a/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml
+++ b/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml
@@ -3,15 +3,15 @@ info:
version: 1.0.0
title: Swagger Petstore
description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification
- termsOfService: http://helloreverb.com/terms/
+ termsOfService: http://swagger.io/terms/
contact:
- name: Wordnik API Team
- email: foo@example.com
- url: http://madskristensen.net
+ name: Swagger API Team
+ email: apiteam@swagger.io
+ url: http://swagger.io
license:
- name: MIT
- url: http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
-host: petstore.swagger.wordnik.com
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+host: petstore.swagger.io
basePath: /api
schemes:
- http
diff --git a/examples/v2.0/yaml/petstore-with-external-docs.yaml b/examples/v2.0/yaml/petstore-with-external-docs.yaml
index 3db47ff362..792864fca0 100644
--- a/examples/v2.0/yaml/petstore-with-external-docs.yaml
+++ b/examples/v2.0/yaml/petstore-with-external-docs.yaml
@@ -10,8 +10,8 @@
email: "apiteam@swagger.io"
url: "http://swagger.io"
license:
- name: "MIT"
- url: "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
+ name: "Apache 2.0"
+ url: "https://www.apache.org/licenses/LICENSE-2.0.html"
externalDocs:
description: "find more info here"
url: "https://swagger.io/about"
diff --git a/examples/v2.0/yaml/petstore.yaml b/examples/v2.0/yaml/petstore.yaml
index 790948cb93..5f41fe091f 100644
--- a/examples/v2.0/yaml/petstore.yaml
+++ b/examples/v2.0/yaml/petstore.yaml
@@ -28,7 +28,7 @@ paths:
format: int32
responses:
"200":
- description: An paged array of pets
+ description: A paged array of pets
headers:
x-next:
type: string
@@ -74,6 +74,7 @@ paths:
$ref: '#/definitions/Error'
definitions:
Pet:
+ type: "object"
required:
- id
- name
@@ -90,6 +91,7 @@ definitions:
items:
$ref: '#/definitions/Pet'
Error:
+ type: "object"
required:
- code
- message
diff --git a/examples/v3.0/api-with-examples.json b/examples/v3.0/api-with-examples.json
new file mode 100644
index 0000000000..0fd2077b3e
--- /dev/null
+++ b/examples/v3.0/api-with-examples.json
@@ -0,0 +1,167 @@
+{
+ "openapi": "3.0.0",
+ "info": {
+ "title": "Simple API overview",
+ "version": "2.0.0"
+ },
+ "paths": {
+ "/": {
+ "get": {
+ "operationId": "listVersionsv2",
+ "summary": "List API versions",
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "content": {
+ "application/json": {
+ "examples": {
+ "foo": {
+ "value": {
+ "versions": [
+ {
+ "status": "CURRENT",
+ "updated": "2011-01-21T11:33:21Z",
+ "id": "v2.0",
+ "links": [
+ {
+ "href": "http://127.0.0.1:8774/v2/",
+ "rel": "self"
+ }
+ ]
+ },
+ {
+ "status": "EXPERIMENTAL",
+ "updated": "2013-07-23T11:33:21Z",
+ "id": "v3.0",
+ "links": [
+ {
+ "href": "http://127.0.0.1:8774/v3/",
+ "rel": "self"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "300": {
+ "description": "300 response",
+ "content": {
+ "application/json": {
+ "examples": {
+ "foo": {
+ "value": "{\n \"versions\": [\n {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v2/\",\n \"rel\": \"self\"\n }\n ]\n },\n {\n \"status\": \"EXPERIMENTAL\",\n \"updated\": \"2013-07-23T11:33:21Z\",\n \"id\": \"v3.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v3/\",\n \"rel\": \"self\"\n }\n ]\n }\n ]\n}\n"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/v2": {
+ "get": {
+ "operationId": "getVersionDetailsv2",
+ "summary": "Show API version details",
+ "responses": {
+ "200": {
+ "description": "200 response",
+ "content": {
+ "application/json": {
+ "examples": {
+ "foo": {
+ "value": {
+ "version": {
+ "status": "CURRENT",
+ "updated": "2011-01-21T11:33:21Z",
+ "media-types": [
+ {
+ "base": "application/xml",
+ "type": "application/vnd.openstack.compute+xml;version=2"
+ },
+ {
+ "base": "application/json",
+ "type": "application/vnd.openstack.compute+json;version=2"
+ }
+ ],
+ "id": "v2.0",
+ "links": [
+ {
+ "href": "http://127.0.0.1:8774/v2/",
+ "rel": "self"
+ },
+ {
+ "href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
+ "type": "application/pdf",
+ "rel": "describedby"
+ },
+ {
+ "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
+ "type": "application/vnd.sun.wadl+xml",
+ "rel": "describedby"
+ },
+ {
+ "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
+ "type": "application/vnd.sun.wadl+xml",
+ "rel": "describedby"
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "203": {
+ "description": "203 response",
+ "content": {
+ "application/json": {
+ "examples": {
+ "foo": {
+ "value": {
+ "version": {
+ "status": "CURRENT",
+ "updated": "2011-01-21T11:33:21Z",
+ "media-types": [
+ {
+ "base": "application/xml",
+ "type": "application/vnd.openstack.compute+xml;version=2"
+ },
+ {
+ "base": "application/json",
+ "type": "application/vnd.openstack.compute+json;version=2"
+ }
+ ],
+ "id": "v2.0",
+ "links": [
+ {
+ "href": "http://23.253.228.211:8774/v2/",
+ "rel": "self"
+ },
+ {
+ "href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
+ "type": "application/pdf",
+ "rel": "describedby"
+ },
+ {
+ "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
+ "type": "application/vnd.sun.wadl+xml",
+ "rel": "describedby"
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.0/api-with-examples.yaml b/examples/v3.0/api-with-examples.yaml
index 8fdee415ad..18726a5476 100644
--- a/examples/v3.0/api-with-examples.yaml
+++ b/examples/v3.0/api-with-examples.yaml
@@ -1,22 +1,23 @@
openapi: "3.0.0"
info:
title: Simple API overview
- version: v2
+ version: 2.0.0
paths:
/:
get:
operationId: listVersionsv2
summary: List API versions
responses:
- 200:
+ '200':
description: |-
200 response
content:
application/json:
examples:
foo:
- value: {
- "versions": [
+ value:
+ {
+ "versions": [
{
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
@@ -39,9 +40,9 @@ paths:
}
]
}
- ]
- }
- 300:
+ ]
+ }
+ '300':
description: |-
300 response
content:
@@ -80,18 +81,19 @@ paths:
operationId: getVersionDetailsv2
summary: Show API version details
responses:
- 200:
+ '200':
description: |-
200 response
content:
application/json:
examples:
foo:
- value: {
- "version": {
- "status": "CURRENT",
- "updated": "2011-01-21T11:33:21Z",
- "media-types": [
+ value:
+ {
+ "version": {
+ "status": "CURRENT",
+ "updated": "2011-01-21T11:33:21Z",
+ "media-types": [
{
"base": "application/xml",
"type": "application/vnd.openstack.compute+xml;version=2"
@@ -100,9 +102,9 @@ paths:
"base": "application/json",
"type": "application/vnd.openstack.compute+json;version=2"
}
- ],
- "id": "v2.0",
- "links": [
+ ],
+ "id": "v2.0",
+ "links": [
{
"href": "http://127.0.0.1:8774/v2/",
"rel": "self"
@@ -122,21 +124,22 @@ paths:
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
}
- ]
+ ]
+ }
}
- }
- 203:
+ '203':
description: |-
203 response
content:
application/json:
examples:
foo:
- value: {
- "version": {
- "status": "CURRENT",
- "updated": "2011-01-21T11:33:21Z",
- "media-types": [
+ value:
+ {
+ "version": {
+ "status": "CURRENT",
+ "updated": "2011-01-21T11:33:21Z",
+ "media-types": [
{
"base": "application/xml",
"type": "application/vnd.openstack.compute+xml;version=2"
@@ -145,9 +148,9 @@ paths:
"base": "application/json",
"type": "application/vnd.openstack.compute+json;version=2"
}
- ],
- "id": "v2.0",
- "links": [
+ ],
+ "id": "v2.0",
+ "links": [
{
"href": "http://23.253.228.211:8774/v2/",
"rel": "self"
@@ -162,6 +165,6 @@ paths:
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
}
- ]
+ ]
+ }
}
- }
diff --git a/examples/v3.0/callback-example.json b/examples/v3.0/callback-example.json
new file mode 100644
index 0000000000..9a4df39b45
--- /dev/null
+++ b/examples/v3.0/callback-example.json
@@ -0,0 +1,84 @@
+{
+ "openapi": "3.0.0",
+ "info": {
+ "title": "Callback Example",
+ "version": "1.0.0"
+ },
+ "paths": {
+ "/streams": {
+ "post": {
+ "description": "subscribes a client to receive out-of-band data",
+ "parameters": [
+ {
+ "name": "callbackUrl",
+ "in": "query",
+ "required": true,
+ "description": "the location where data will be sent. Must be network accessible\nby the source server\n",
+ "schema": {
+ "type": "string",
+ "format": "uri",
+ "example": "https://tonys-server.com"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "subscription successfully created",
+ "content": {
+ "application/json": {
+ "schema": {
+ "description": "subscription information",
+ "required": [
+ "subscriptionId"
+ ],
+ "properties": {
+ "subscriptionId": {
+ "description": "this unique identifier allows management of the subscription",
+ "type": "string",
+ "example": "2531329f-fb09-4ef7-887e-84e648214436"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "callbacks": {
+ "onData": {
+ "{$request.query.callbackUrl}/data": {
+ "post": {
+ "requestBody": {
+ "description": "subscription payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "timestamp": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "userData": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "202": {
+ "description": "Your server implementation should return this HTTP status code\nif the data was received successfully\n"
+ },
+ "204": {
+ "description": "Your server should return this HTTP status code if no longer interested\nin further updates\n"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.0/callback-example.yaml b/examples/v3.0/callback-example.yaml
index c698b9704c..262b8df518 100644
--- a/examples/v3.0/callback-example.yaml
+++ b/examples/v3.0/callback-example.yaml
@@ -1,3 +1,7 @@
+openapi: 3.0.0
+info:
+ title: Callback Example
+ version: 1.0.0
paths:
/streams:
post:
@@ -32,19 +36,20 @@ paths:
onData:
# when data is sent, it will be sent to the `callbackUrl` provided
# when making the subscription PLUS the suffix `/data`
- {$request.query.callbackUrl}/data:
+ '{$request.query.callbackUrl}/data':
post:
requestBody:
description: subscription payload
content:
application/json:
schema:
+ type: object
properties:
timestamp:
type: string
format: date-time
userData:
- $ref: '#/components/schemas/UserLogData'
+ type: string
responses:
'202':
description: |
diff --git a/examples/v3.0/link-example.json b/examples/v3.0/link-example.json
new file mode 100644
index 0000000000..bc98e635f1
--- /dev/null
+++ b/examples/v3.0/link-example.json
@@ -0,0 +1,323 @@
+{
+ "openapi": "3.0.0",
+ "info": {
+ "title": "Link Example",
+ "version": "1.0.0"
+ },
+ "paths": {
+ "/2.0/users/{username}": {
+ "get": {
+ "operationId": "getUserByName",
+ "parameters": [
+ {
+ "name": "username",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The User",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ },
+ "links": {
+ "userRepositories": {
+ "$ref": "#/components/links/UserRepositories"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/2.0/repositories/{username}": {
+ "get": {
+ "operationId": "getRepositoriesByOwner",
+ "parameters": [
+ {
+ "name": "username",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "repositories owned by the supplied user",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/repository"
+ }
+ }
+ }
+ },
+ "links": {
+ "userRepository": {
+ "$ref": "#/components/links/UserRepository"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/2.0/repositories/{username}/{slug}": {
+ "get": {
+ "operationId": "getRepository",
+ "parameters": [
+ {
+ "name": "username",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The repository",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/repository"
+ }
+ }
+ },
+ "links": {
+ "repositoryPullRequests": {
+ "$ref": "#/components/links/RepositoryPullRequests"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/2.0/repositories/{username}/{slug}/pullrequests": {
+ "get": {
+ "operationId": "getPullRequestsByRepository",
+ "parameters": [
+ {
+ "name": "username",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "state",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "open",
+ "merged",
+ "declined"
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "an array of pull request objects",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/pullrequest"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/2.0/repositories/{username}/{slug}/pullrequests/{pid}": {
+ "get": {
+ "operationId": "getPullRequestsById",
+ "parameters": [
+ {
+ "name": "username",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "pid",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "a pull request object",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/pullrequest"
+ }
+ }
+ },
+ "links": {
+ "pullRequestMerge": {
+ "$ref": "#/components/links/PullRequestMerge"
+ }
+ }
+ }
+ }
+ }
+ },
+ "/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge": {
+ "post": {
+ "operationId": "mergePullRequest",
+ "parameters": [
+ {
+ "name": "username",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "slug",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "pid",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "the PR was successfully merged"
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "links": {
+ "UserRepositories": {
+ "operationId": "getRepositoriesByOwner",
+ "parameters": {
+ "username": "$response.body#/username"
+ }
+ },
+ "UserRepository": {
+ "operationId": "getRepository",
+ "parameters": {
+ "username": "$response.body#/owner/username",
+ "slug": "$response.body#/slug"
+ }
+ },
+ "RepositoryPullRequests": {
+ "operationId": "getPullRequestsByRepository",
+ "parameters": {
+ "username": "$response.body#/owner/username",
+ "slug": "$response.body#/slug"
+ }
+ },
+ "PullRequestMerge": {
+ "operationId": "mergePullRequest",
+ "parameters": {
+ "username": "$response.body#/author/username",
+ "slug": "$response.body#/repository/slug",
+ "pid": "$response.body#/id"
+ }
+ }
+ },
+ "schemas": {
+ "user": {
+ "type": "object",
+ "properties": {
+ "username": {
+ "type": "string"
+ },
+ "uuid": {
+ "type": "string"
+ }
+ }
+ },
+ "repository": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string"
+ },
+ "owner": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ },
+ "pullrequest": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "title": {
+ "type": "string"
+ },
+ "repository": {
+ "$ref": "#/components/schemas/repository"
+ },
+ "author": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.0/petstore-expanded.json b/examples/v3.0/petstore-expanded.json
new file mode 100644
index 0000000000..420eede6a8
--- /dev/null
+++ b/examples/v3.0/petstore-expanded.json
@@ -0,0 +1,242 @@
+{
+ "openapi": "3.0.0",
+ "info": {
+ "version": "1.0.0",
+ "title": "Swagger Petstore",
+ "description": "A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification",
+ "termsOfService": "http://swagger.io/terms/",
+ "contact": {
+ "name": "Swagger API Team",
+ "email": "apiteam@swagger.io",
+ "url": "http://swagger.io"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://petstore.swagger.io/v2"
+ }
+ ],
+ "paths": {
+ "/pets": {
+ "get": {
+ "description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n",
+ "operationId": "findPets",
+ "parameters": [
+ {
+ "name": "tags",
+ "in": "query",
+ "description": "tags to filter by",
+ "required": false,
+ "style": "form",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "maximum number of results to return",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "description": "Creates a new pet in the store. Duplicates are allowed",
+ "operationId": "addPet",
+ "requestBody": {
+ "description": "Pet to add to the store",
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NewPet"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/pets/{id}": {
+ "get": {
+ "description": "Returns a user based on a single ID, if the user does not have access to the pet",
+ "operationId": "find pet by id",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "ID of pet to fetch",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "description": "deletes a single pet based on the ID supplied",
+ "operationId": "deletePet",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "ID of pet to delete",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "pet deleted"
+ },
+ "default": {
+ "description": "unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "Pet": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/NewPet"
+ },
+ {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ }
+ ]
+ },
+ "NewPet": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "tag": {
+ "type": "string"
+ }
+ }
+ },
+ "Error": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.0/petstore-expanded.yaml b/examples/v3.0/petstore-expanded.yaml
index f587075899..7e5bff0efa 100644
--- a/examples/v3.0/petstore-expanded.yaml
+++ b/examples/v3.0/petstore-expanded.yaml
@@ -2,17 +2,17 @@ openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
- description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification
+ description: A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification
termsOfService: http://swagger.io/terms/
contact:
name: Swagger API Team
- email: foo@example.com
- url: http://madskristensen.net
+ email: apiteam@swagger.io
+ url: http://swagger.io
license:
- name: MIT
- url: http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- - url: http://petstore.swagger.io/api
+ - url: https://petstore.swagger.io/v2
paths:
/pets:
get:
@@ -40,7 +40,7 @@ paths:
type: integer
format: int32
responses:
- 200:
+ '200':
description: pet response
content:
application/json:
@@ -55,7 +55,7 @@ paths:
schema:
$ref: '#/components/schemas/Error'
post:
- description: Creates a new pet in the store. Duplicates are allowed
+ description: Creates a new pet in the store. Duplicates are allowed
operationId: addPet
requestBody:
description: Pet to add to the store
@@ -65,7 +65,7 @@ paths:
schema:
$ref: '#/components/schemas/NewPet'
responses:
- 200:
+ '200':
description: pet response
content:
application/json:
@@ -90,7 +90,7 @@ paths:
type: integer
format: int64
responses:
- 200:
+ '200':
description: pet response
content:
application/json:
@@ -114,7 +114,7 @@ paths:
type: integer
format: int64
responses:
- 204:
+ '204':
description: pet deleted
default:
description: unexpected error
@@ -127,7 +127,8 @@ components:
Pet:
allOf:
- $ref: '#/components/schemas/NewPet'
- - required:
+ - type: object
+ required:
- id
properties:
id:
@@ -135,6 +136,7 @@ components:
format: int64
NewPet:
+ type: object
required:
- name
properties:
@@ -144,6 +146,7 @@ components:
type: string
Error:
+ type: object
required:
- code
- message
diff --git a/examples/v3.0/petstore.json b/examples/v3.0/petstore.json
new file mode 100644
index 0000000000..d14eb5e6d0
--- /dev/null
+++ b/examples/v3.0/petstore.json
@@ -0,0 +1,189 @@
+{
+ "openapi": "3.0.0",
+ "info": {
+ "version": "1.0.0",
+ "title": "Swagger Petstore",
+ "license": {
+ "name": "MIT"
+ }
+ },
+ "servers": [
+ {
+ "url": "http://petstore.swagger.io/v1"
+ }
+ ],
+ "paths": {
+ "/pets": {
+ "get": {
+ "summary": "List all pets",
+ "operationId": "listPets",
+ "tags": [
+ "pets"
+ ],
+ "parameters": [
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "How many items to return at one time (max 100)",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "maximum": 100,
+ "format": "int32"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "A paged array of pets",
+ "headers": {
+ "x-next": {
+ "description": "A link to the next page of responses",
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pets"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "summary": "Create a pet",
+ "operationId": "createPets",
+ "tags": [
+ "pets"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "201": {
+ "description": "Null response"
+ },
+ "default": {
+ "description": "unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/pets/{petId}": {
+ "get": {
+ "summary": "Info for a specific pet",
+ "operationId": "showPetById",
+ "tags": [
+ "pets"
+ ],
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "required": true,
+ "description": "The id of the pet to retrieve",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Expected response to a valid request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "Pet": {
+ "type": "object",
+ "required": [
+ "id",
+ "name"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ },
+ "tag": {
+ "type": "string"
+ }
+ }
+ },
+ "Pets": {
+ "type": "array",
+ "maxItems": 100,
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ },
+ "Error": {
+ "type": "object",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.0/petstore.yaml b/examples/v3.0/petstore.yaml
index b444f02531..7ed987ff63 100644
--- a/examples/v3.0/petstore.yaml
+++ b/examples/v3.0/petstore.yaml
@@ -20,10 +20,11 @@ paths:
required: false
schema:
type: integer
+ maximum: 100
format: int32
responses:
- 200:
- description: An paged array of pets
+ '200':
+ description: A paged array of pets
headers:
x-next:
description: A link to the next page of responses
@@ -44,8 +45,14 @@ paths:
operationId: createPets
tags:
- pets
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ required: true
responses:
- 201:
+ '201':
description: Null response
default:
description: unexpected error
@@ -67,12 +74,12 @@ paths:
schema:
type: string
responses:
- 200:
+ '200':
description: Expected response to a valid request
content:
application/json:
schema:
- $ref: "#/components/schemas/Pets"
+ $ref: "#/components/schemas/Pet"
default:
description: unexpected error
content:
@@ -82,6 +89,7 @@ paths:
components:
schemas:
Pet:
+ type: object
required:
- id
- name
@@ -95,9 +103,11 @@ components:
type: string
Pets:
type: array
+ maxItems: 100
items:
$ref: "#/components/schemas/Pet"
Error:
+ type: object
required:
- code
- message
diff --git a/examples/v3.0/uber.yaml b/examples/v3.0/uber.yaml
deleted file mode 100644
index 2c77b440f9..0000000000
--- a/examples/v3.0/uber.yaml
+++ /dev/null
@@ -1,297 +0,0 @@
-# this is an example of the Uber API
-# as a demonstration of an API spec in YAML
-openapi: "3.0.0"
-info:
- title: Uber API
- description: Move your app forward with the Uber API
- version: "1.0.0"
-servers:
- - url: https://api.uber.com/v1
-paths:
- /products:
- get:
- summary: Product Types
- description: The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.
- parameters:
- - name: latitude
- in: query
- description: Latitude component of location.
- required: true
- schema:
- type: number
- format: double
- - name: longitude
- in: query
- description: Longitude component of location.
- required: true
- schema:
- type: number
- format: double
- security:
- - apikey: []
- tags:
- - Products
- responses:
- 200:
- description: An array of products
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/ProductList"
- default:
- description: Unexpected error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Error"
- /estimates/price:
- get:
- summary: Price Estimates
- description: The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.
The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.
- parameters:
- - name: start_latitude
- in: query
- description: Latitude component of start location.
- required: true
- schema:
- type: number
- format: double
- - name: start_longitude
- in: query
- description: Longitude component of start location.
- required: true
- schema:
- type: number
- format: double
- - name: end_latitude
- in: query
- description: Latitude component of end location.
- required: true
- schema:
- type: number
- format: double
- - name: end_longitude
- in: query
- description: Longitude component of end location.
- required: true
- schema:
- type: number
- format: double
- tags:
- - Estimates
- responses:
- 200:
- description: An array of price estimates by product
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/PriceEstimate"
- default:
- description: Unexpected error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Error"
- /estimates/time:
- get:
- summary: Time Estimates
- description: The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.
- parameters:
- - name: start_latitude
- in: query
- description: Latitude component of start location.
- required: true
- schema:
- type: number
- format: double
- - name: start_longitude
- in: query
- description: Longitude component of start location.
- required: true
- schema:
- type: number
- format: double
- - name: customer_uuid
- in: query
- schema:
- type: string
- format: uuid
- description: Unique customer identifier to be used for experience customization.
- - name: product_id
- in: query
- schema:
- type: string
- description: Unique identifier representing a specific product for a given latitude & longitude.
- tags:
- - Estimates
- responses:
- 200:
- description: An array of products
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/Product"
- default:
- description: Unexpected error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Error"
- /me:
- get:
- summary: User Profile
- description: The User Profile endpoint returns information about the Uber user that has authorized with the application.
- tags:
- - User
- responses:
- 200:
- description: Profile information for a user
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Profile"
- default:
- description: Unexpected error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Error"
- /history:
- get:
- summary: User Activity
- description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.
The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
- parameters:
- - name: offset
- in: query
- schema:
- type: integer
- format: int32
- description: Offset the list of returned results by this amount. Default is zero.
- - name: limit
- in: query
- schema:
- type: integer
- format: int32
- description: Number of items to retrieve. Default is 5, maximum is 100.
- tags:
- - User
- responses:
- 200:
- description: History information for the given user
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Activities"
- default:
- description: Unexpected error
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Error"
-components:
- securitySchemes:
- apikey:
- type: apiKey
- name: server_token
- in: query
- schemas:
- Product:
- properties:
- product_id:
- type: string
- description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
- description:
- type: string
- description: Description of product.
- display_name:
- type: string
- description: Display name of product.
- capacity:
- type: integer
- description: Capacity of product. For example, 4 people.
- image:
- type: string
- description: Image URL representing the product.
- ProductList:
- properties:
- products:
- description: Contains the list of products
- type: array
- items:
- $ref: "#/components/schemas/Product"
- PriceEstimate:
- properties:
- product_id:
- type: string
- description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles
- currency_code:
- type: string
- description: "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code."
- display_name:
- type: string
- description: Display name of product.
- estimate:
- type: string
- description: Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI.
- low_estimate:
- type: number
- description: Lower bound of the estimated price.
- high_estimate:
- type: number
- description: Upper bound of the estimated price.
- surge_multiplier:
- type: number
- description: Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
- Profile:
- properties:
- first_name:
- type: string
- description: First name of the Uber user.
- last_name:
- type: string
- description: Last name of the Uber user.
- email:
- type: string
- description: Email address of the Uber user
- picture:
- type: string
- description: Image URL of the Uber user.
- promo_code:
- type: string
- description: Promo code of the Uber user.
- Activity:
- properties:
- uuid:
- type: string
- description: Unique identifier for the activity
- Activities:
- properties:
- offset:
- type: integer
- format: int32
- description: Position in pagination.
- limit:
- type: integer
- format: int32
- description: Number of items to retrieve (100 max).
- count:
- type: integer
- format: int32
- description: Total number of items available.
- history:
- type: array
- items:
- $ref: "#/components/schemas/Activity"
- Error:
- properties:
- code:
- type: string
- message:
- type: string
- fields:
- type: string
-
diff --git a/examples/v3.0/uspto.json b/examples/v3.0/uspto.json
new file mode 100644
index 0000000000..cd32f64c5f
--- /dev/null
+++ b/examples/v3.0/uspto.json
@@ -0,0 +1,252 @@
+{
+ "openapi": "3.0.1",
+ "servers": [
+ {
+ "url": "{scheme}://developer.uspto.gov/ds-api",
+ "variables": {
+ "scheme": {
+ "description": "The Data Set API is accessible via https and http",
+ "enum": [
+ "https",
+ "http"
+ ],
+ "default": "https"
+ }
+ }
+ }
+ ],
+ "info": {
+ "description": "The Data Set API (DSAPI) allows the public users to discover and search USPTO exported data sets. This is a generic API that allows USPTO users to make any CSV based data files searchable through API. With the help of GET call, it returns the list of data fields that are searchable. With the help of POST call, data can be fetched based on the filters on the field names. Please note that POST call is used to search the actual data. The reason for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters.",
+ "version": "1.0.0",
+ "title": "USPTO Data Set API",
+ "contact": {
+ "name": "Open Data Portal",
+ "url": "https://developer.uspto.gov",
+ "email": "developer@uspto.gov"
+ }
+ },
+ "tags": [
+ {
+ "name": "metadata",
+ "description": "Find out about the data sets"
+ },
+ {
+ "name": "search",
+ "description": "Search a data set"
+ }
+ ],
+ "paths": {
+ "/": {
+ "get": {
+ "tags": [
+ "metadata"
+ ],
+ "operationId": "list-data-sets",
+ "summary": "List available data sets",
+ "responses": {
+ "200": {
+ "description": "Returns a list of data sets",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/dataSetList"
+ },
+ "example": {
+ "total": 2,
+ "apis": [
+ {
+ "apiKey": "oa_citations",
+ "apiVersionNumber": "v1",
+ "apiUrl": "https://developer.uspto.gov/ds-api/oa_citations/v1/fields",
+ "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json"
+ },
+ {
+ "apiKey": "cancer_moonshot",
+ "apiVersionNumber": "v1",
+ "apiUrl": "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields",
+ "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json"
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{dataset}/{version}/fields": {
+ "get": {
+ "tags": [
+ "metadata"
+ ],
+ "summary": "Provides the general information about the API and the list of fields that can be used to query the dataset.",
+ "description": "This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below.",
+ "operationId": "list-searchable-fields",
+ "parameters": [
+ {
+ "name": "dataset",
+ "in": "path",
+ "description": "Name of the dataset.",
+ "required": true,
+ "example": "oa_citations",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "version",
+ "in": "path",
+ "description": "Version of the dataset.",
+ "required": true,
+ "example": "v1",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The dataset API for the given version is found and it is accessible to consume.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The combination of dataset name and version is not found in the system or it is not published yet to be consumed by public.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/{dataset}/{version}/records": {
+ "post": {
+ "tags": [
+ "search"
+ ],
+ "summary": "Provides search capability for the data set with the given search criteria.",
+ "description": "This API is based on Solr/Lucene Search. The data is indexed using SOLR. This GET API returns the list of all the searchable field names that are in the Solr Index. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the Solr/Lucene Syntax. Please refer https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for the query syntax. List of field names that are searchable can be determined using above GET api.",
+ "operationId": "perform-search",
+ "parameters": [
+ {
+ "name": "version",
+ "in": "path",
+ "description": "Version of the dataset.",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "default": "v1"
+ }
+ },
+ {
+ "name": "dataset",
+ "in": "path",
+ "description": "Name of the dataset. In this case, the default value is oa_citations",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "default": "oa_citations"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "No matching record found for the given criteria."
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/x-www-form-urlencoded": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "criteria": {
+ "description": "Uses Lucene Query Syntax in the format of propertyName:value, propertyName:[num1 TO num2] and date range format: propertyName:[yyyyMMdd TO yyyyMMdd]. In the response please see the 'docs' element which has the list of record objects. Each record structure would consist of all the fields and their corresponding values.",
+ "type": "string",
+ "default": "*:*"
+ },
+ "start": {
+ "description": "Starting record number. Default value is 0.",
+ "type": "integer",
+ "default": 0
+ },
+ "rows": {
+ "description": "Specify number of rows to be returned. If you run the search with default values, in the response you will see 'numFound' attribute which will tell the number of records available in the dataset.",
+ "type": "integer",
+ "default": 100
+ }
+ },
+ "required": [
+ "criteria"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "dataSetList": {
+ "type": "object",
+ "properties": {
+ "total": {
+ "type": "integer"
+ },
+ "apis": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "apiKey": {
+ "type": "string",
+ "description": "To be used as a dataset parameter value"
+ },
+ "apiVersionNumber": {
+ "type": "string",
+ "description": "To be used as a version parameter value"
+ },
+ "apiUrl": {
+ "type": "string",
+ "format": "uriref",
+ "description": "The URL describing the dataset's fields"
+ },
+ "apiDocumentationUrl": {
+ "type": "string",
+ "format": "uriref",
+ "description": "A URL to the API console for each API"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.0/uspto.yaml b/examples/v3.0/uspto.yaml
new file mode 100644
index 0000000000..d3011520d0
--- /dev/null
+++ b/examples/v3.0/uspto.yaml
@@ -0,0 +1,210 @@
+openapi: 3.0.1
+servers:
+ - url: '{scheme}://developer.uspto.gov/ds-api'
+ variables:
+ scheme:
+ description: 'The Data Set API is accessible via https and http'
+ enum:
+ - 'https'
+ - 'http'
+ default: 'https'
+info:
+ description: >-
+ The Data Set API (DSAPI) allows the public users to discover and search
+ USPTO exported data sets. This is a generic API that allows USPTO users to
+ make any CSV based data files searchable through API. With the help of GET
+ call, it returns the list of data fields that are searchable. With the help
+ of POST call, data can be fetched based on the filters on the field names.
+ Please note that POST call is used to search the actual data. The reason for
+ the POST call is that it allows users to specify any complex search criteria
+ without worry about the GET size limitations as well as encoding of the
+ input parameters.
+ version: 1.0.0
+ title: USPTO Data Set API
+ contact:
+ name: Open Data Portal
+ url: 'https://developer.uspto.gov'
+ email: developer@uspto.gov
+tags:
+ - name: metadata
+ description: Find out about the data sets
+ - name: search
+ description: Search a data set
+paths:
+ /:
+ get:
+ tags:
+ - metadata
+ operationId: list-data-sets
+ summary: List available data sets
+ responses:
+ '200':
+ description: Returns a list of data sets
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/dataSetList'
+ example:
+ {
+ "total": 2,
+ "apis": [
+ {
+ "apiKey": "oa_citations",
+ "apiVersionNumber": "v1",
+ "apiUrl": "https://developer.uspto.gov/ds-api/oa_citations/v1/fields",
+ "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json"
+ },
+ {
+ "apiKey": "cancer_moonshot",
+ "apiVersionNumber": "v1",
+ "apiUrl": "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields",
+ "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json"
+ }
+ ]
+ }
+ /{dataset}/{version}/fields:
+ get:
+ tags:
+ - metadata
+ summary: >-
+ Provides the general information about the API and the list of fields
+ that can be used to query the dataset.
+ description: >-
+ This GET API returns the list of all the searchable field names that are
+ in the oa_citations. Please see the 'fields' attribute which returns an
+ array of field names. Each field or a combination of fields can be
+ searched using the syntax options shown below.
+ operationId: list-searchable-fields
+ parameters:
+ - name: dataset
+ in: path
+ description: 'Name of the dataset.'
+ required: true
+ example: "oa_citations"
+ schema:
+ type: string
+ - name: version
+ in: path
+ description: Version of the dataset.
+ required: true
+ example: "v1"
+ schema:
+ type: string
+ responses:
+ '200':
+ description: >-
+ The dataset API for the given version is found and it is accessible
+ to consume.
+ content:
+ application/json:
+ schema:
+ type: string
+ '404':
+ description: >-
+ The combination of dataset name and version is not found in the
+ system or it is not published yet to be consumed by public.
+ content:
+ application/json:
+ schema:
+ type: string
+ /{dataset}/{version}/records:
+ post:
+ tags:
+ - search
+ summary: >-
+ Provides search capability for the data set with the given search
+ criteria.
+ description: >-
+ This API is based on Solr/Lucene Search. The data is indexed using
+ SOLR. This GET API returns the list of all the searchable field names
+ that are in the Solr Index. Please see the 'fields' attribute which
+ returns an array of field names. Each field or a combination of fields
+ can be searched using the Solr/Lucene Syntax. Please refer
+ https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for
+ the query syntax. List of field names that are searchable can be
+ determined using above GET api.
+ operationId: perform-search
+ parameters:
+ - name: version
+ in: path
+ description: Version of the dataset.
+ required: true
+ schema:
+ type: string
+ default: v1
+ - name: dataset
+ in: path
+ description: 'Name of the dataset. In this case, the default value is oa_citations'
+ required: true
+ schema:
+ type: string
+ default: oa_citations
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: object
+ additionalProperties:
+ type: object
+ '404':
+ description: No matching record found for the given criteria.
+ requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ criteria:
+ description: >-
+ Uses Lucene Query Syntax in the format of
+ propertyName:value, propertyName:[num1 TO num2] and date
+ range format: propertyName:[yyyyMMdd TO yyyyMMdd]. In the
+ response please see the 'docs' element which has the list of
+ record objects. Each record structure would consist of all
+ the fields and their corresponding values.
+ type: string
+ default: '*:*'
+ start:
+ description: Starting record number. Default value is 0.
+ type: integer
+ default: 0
+ rows:
+ description: >-
+ Specify number of rows to be returned. If you run the search
+ with default values, in the response you will see 'numFound'
+ attribute which will tell the number of records available in
+ the dataset.
+ type: integer
+ default: 100
+ required:
+ - criteria
+components:
+ schemas:
+ dataSetList:
+ type: object
+ properties:
+ total:
+ type: integer
+ apis:
+ type: array
+ items:
+ type: object
+ properties:
+ apiKey:
+ type: string
+ description: To be used as a dataset parameter value
+ apiVersionNumber:
+ type: string
+ description: To be used as a version parameter value
+ apiUrl:
+ type: string
+ format: uriref
+ description: "The URL describing the dataset's fields"
+ apiDocumentationUrl:
+ type: string
+ format: uriref
+ description: A URL to the API console for each API
diff --git a/examples/v3.1/non-oauth-scopes.json b/examples/v3.1/non-oauth-scopes.json
new file mode 100644
index 0000000000..b3e5990426
--- /dev/null
+++ b/examples/v3.1/non-oauth-scopes.json
@@ -0,0 +1,31 @@
+{
+ "openapi": "3.1.0",
+ "info": {
+ "title": "Non-oAuth Scopes example",
+ "version": "1.0.0"
+ },
+ "paths": {
+ "/users": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": [
+ "read:users",
+ "public"
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "components": {
+ "securitySchemes": {
+ "bearerAuth": {
+ "type": "http",
+ "scheme": "bearer",
+ "bearerFormat": "jwt",
+ "description": "note: non-oauth scopes are not defined at the securityScheme level"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.1/non-oauth-scopes.yaml b/examples/v3.1/non-oauth-scopes.yaml
new file mode 100644
index 0000000000..e757452f38
--- /dev/null
+++ b/examples/v3.1/non-oauth-scopes.yaml
@@ -0,0 +1,19 @@
+openapi: 3.1.0
+info:
+ title: Non-oAuth Scopes example
+ version: 1.0.0
+paths:
+ /users:
+ get:
+ security:
+ - bearerAuth:
+ - 'read:users'
+ - 'public'
+components:
+ securitySchemes:
+ bearerAuth:
+ type: http
+ scheme: bearer
+ bearerFormat: jwt
+ description: 'note: non-oauth scopes are not defined at the securityScheme level'
+
diff --git a/examples/v3.1/webhook-example.json b/examples/v3.1/webhook-example.json
new file mode 100644
index 0000000000..712a42f120
--- /dev/null
+++ b/examples/v3.1/webhook-example.json
@@ -0,0 +1,50 @@
+{
+ "openapi": "3.1.0",
+ "info": {
+ "title": "Webhook Example",
+ "version": "1.0.0"
+ },
+ "webhooks": {
+ "newPet": {
+ "post": {
+ "requestBody": {
+ "description": "Information about a new pet in the system",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Return a 200 status to indicate that the data was received successfully"
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "Pet": {
+ "required": [
+ "id",
+ "name"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ },
+ "tag": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/v3.1/webhook-example.yaml b/examples/v3.1/webhook-example.yaml
new file mode 100644
index 0000000000..2ac1cda985
--- /dev/null
+++ b/examples/v3.1/webhook-example.yaml
@@ -0,0 +1,35 @@
+openapi: 3.1.0
+info:
+ title: Webhook Example
+ version: 1.0.0
+# Since OAS 3.1.0 the paths element isn't necessary. Now a valid OpenAPI Document can describe only paths, webhooks, or even only reusable components
+webhooks:
+ # Each webhook needs a name
+ newPet:
+ # This is a Path Item Object, the only difference is that the request is initiated by the API provider
+ post:
+ requestBody:
+ description: Information about a new pet in the system
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ responses:
+ "200":
+ description: Return a 200 status to indicate that the data was received successfully
+
+components:
+ schemas:
+ Pet:
+ required:
+ - id
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ tag:
+ type: string
+
diff --git a/fixtures/v1.2/helloworld/server/README.md b/fixtures/v1.2/helloworld/server/README.md
deleted file mode 100644
index bd351e2c1c..0000000000
--- a/fixtures/v1.2/helloworld/server/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# All-in-one Static Hello World Sample
-
-This sample project provides an all-one-one package demo for the Hello World sample described in the [wiki](https://github.com/swagger-api/swagger-spec/wiki/Hello-World-Sample).
-
-## Requirements
-
-This samples requires Java 5 or above and [Maven](http://maven.apache.org) installed.
-
-## Run the sample
-
-In your favorite command-line, run:
-
-```
-mvn jetty:run
-```
-
-Then in your favorite web browser, open:
-```
-http://localhost:8000
-```
diff --git a/fixtures/v1.2/helloworld/server/pom.xml b/fixtures/v1.2/helloworld/server/pom.xml
deleted file mode 100644
index 3a2c61c671..0000000000
--- a/fixtures/v1.2/helloworld/server/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-
- 4.0.0
- io.swagger
- swagger-demo
- jar
- swagger-demo
- 1.0.1-SNAPSHOT
-
- 2.2.0
-
-
-
- src/main/scala
- src/test/scala
-
-
- net.alchim31.maven
- scala-maven-plugin
- ${maven-plugin.version}
-
-
-
- compile
- testCompile
-
-
-
-
-
- -Xms64m
- -Xmx1024m
-
-
-
-
- maven-surefire-plugin
-
- once
- false
-
-
-
- maven-dependency-plugin
-
-
- package
-
- copy-dependencies
-
-
- ${project.build.directory}/lib
-
-
-
-
-
- org.mortbay.jetty
- jetty-maven-plugin
- ${jetty-version}
-
-
- /
-
-
-
- 8000
- 60000
- 8443
-
-
-
-
-
- start-jetty
- pre-integration-test
-
- run
-
-
- 0
- true
-
-
-
- stop-jetty
- post-integration-test
-
- stop
-
-
-
-
-
-
-
-
- sonatype-snapshots
- https://oss.sonatype.org/content/repositories/snapshots
-
-
- sonatype-releases
- https://oss.sonatype.org/content/repositories/releases
-
-
-
- 3.1.0
- 7.6.0.v20120127
-
-
-
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/api-docs b/fixtures/v1.2/helloworld/server/src/main/webapp/api-docs
deleted file mode 100644
index 6f2f3cb95b..0000000000
--- a/fixtures/v1.2/helloworld/server/src/main/webapp/api-docs
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "swaggerVersion": "1.2",
- "apis": [
- {
- "path": "http://localhost:8000/listings/greetings",
- "description": "Generating greetings in our application."
- }
- ]
-}
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/css/highlight.default.css b/fixtures/v1.2/helloworld/server/src/main/webapp/css/highlight.default.css
deleted file mode 100644
index e417fc1799..0000000000
--- a/fixtures/v1.2/helloworld/server/src/main/webapp/css/highlight.default.css
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-
-Original style from softwaremaniacs.org (c) Ivan Sagalaev
-
-*/
-
-pre code {
- display: block; padding: 0.5em;
- background: #F0F0F0;
-}
-
-pre code,
-pre .subst,
-pre .tag .title,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title {
- color: black;
-}
-
-pre .string,
-pre .title,
-pre .constant,
-pre .parent,
-pre .tag .value,
-pre .rules .value,
-pre .rules .value .number,
-pre .preprocessor,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .aggregate,
-pre .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .addition,
-pre .flow,
-pre .stream,
-pre .bash .variable,
-pre .apache .tag,
-pre .apache .cbracket,
-pre .tex .command,
-pre .tex .special,
-pre .erlang_repl .function_or_atom,
-pre .markdown .header {
- color: #800;
-}
-
-pre .comment,
-pre .annotation,
-pre .template_comment,
-pre .diff .header,
-pre .chunk,
-pre .markdown .blockquote {
- color: #888;
-}
-
-pre .number,
-pre .date,
-pre .regexp,
-pre .literal,
-pre .smalltalk .symbol,
-pre .smalltalk .char,
-pre .go .constant,
-pre .change,
-pre .markdown .bullet,
-pre .markdown .link_url {
- color: #080;
-}
-
-pre .label,
-pre .javadoc,
-pre .ruby .string,
-pre .decorator,
-pre .filter .argument,
-pre .localvars,
-pre .array,
-pre .attr_selector,
-pre .important,
-pre .pseudo,
-pre .pi,
-pre .doctype,
-pre .deletion,
-pre .envvar,
-pre .shebang,
-pre .apache .sqbracket,
-pre .nginx .built_in,
-pre .tex .formula,
-pre .erlang_repl .reserved,
-pre .prompt,
-pre .markdown .link_label,
-pre .vhdl .attribute,
-pre .clojure .attribute,
-pre .coffeescript .property {
- color: #88F
-}
-
-pre .keyword,
-pre .id,
-pre .phpdoc,
-pre .title,
-pre .built_in,
-pre .aggregate,
-pre .css .tag,
-pre .javadoctag,
-pre .phpdoc,
-pre .yardoctag,
-pre .smalltalk .class,
-pre .winutils,
-pre .bash .variable,
-pre .apache .tag,
-pre .go .typename,
-pre .tex .command,
-pre .markdown .strong,
-pre .request,
-pre .status {
- font-weight: bold;
-}
-
-pre .markdown .emphasis {
- font-style: italic;
-}
-
-pre .nginx .built_in {
- font-weight: normal;
-}
-
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
- opacity: 0.5;
-}
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/css/screen.css b/fixtures/v1.2/helloworld/server/src/main/webapp/css/screen.css
deleted file mode 100644
index 1627ecd0d3..0000000000
--- a/fixtures/v1.2/helloworld/server/src/main/webapp/css/screen.css
+++ /dev/null
@@ -1,1070 +0,0 @@
-/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */
-html,
-body,
-div,
-span,
-applet,
-object,
-iframe,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-p,
-blockquote,
-pre,
-a,
-abbr,
-acronym,
-address,
-big,
-cite,
-code,
-del,
-dfn,
-em,
-img,
-ins,
-kbd,
-q,
-s,
-samp,
-small,
-strike,
-strong,
-sub,
-sup,
-tt,
-var,
-b,
-u,
-i,
-center,
-dl,
-dt,
-dd,
-ol,
-ul,
-li,
-fieldset,
-form,
-label,
-legend,
-table,
-caption,
-tbody,
-tfoot,
-thead,
-tr,
-th,
-td,
-article,
-aside,
-canvas,
-details,
-embed,
-figure,
-figcaption,
-footer,
-header,
-hgroup,
-menu,
-nav,
-output,
-ruby,
-section,
-summary,
-time,
-mark,
-audio,
-video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-/* HTML5 display-role reset for older browsers */
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-menu,
-nav,
-section {
- display: block;
-}
-body {
- line-height: 1;
-}
-ol,
-ul {
- list-style: none;
-}
-blockquote,
-q {
- quotes: none;
-}
-blockquote:before,
-blockquote:after,
-q:before,
-q:after {
- content: '';
- content: none;
-}
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-.swagger-ui-wrap {
- line-height: 1;
- font-family: "Droid Sans", sans-serif;
- max-width: 960px;
- margin-left: auto;
- margin-right: auto;
-}
-.swagger-ui-wrap b,
-.swagger-ui-wrap strong {
- font-family: "Droid Sans", sans-serif;
- font-weight: bold;
-}
-.swagger-ui-wrap q,
-.swagger-ui-wrap blockquote {
- quotes: none;
-}
-.swagger-ui-wrap p {
- line-height: 1.4em;
- padding: 0 0 10px;
- color: #333333;
-}
-.swagger-ui-wrap q:before,
-.swagger-ui-wrap q:after,
-.swagger-ui-wrap blockquote:before,
-.swagger-ui-wrap blockquote:after {
- content: none;
-}
-.swagger-ui-wrap .heading_with_menu h1,
-.swagger-ui-wrap .heading_with_menu h2,
-.swagger-ui-wrap .heading_with_menu h3,
-.swagger-ui-wrap .heading_with_menu h4,
-.swagger-ui-wrap .heading_with_menu h5,
-.swagger-ui-wrap .heading_with_menu h6 {
- display: block;
- clear: none;
- float: left;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -ms-box-sizing: border-box;
- box-sizing: border-box;
- width: 60%;
-}
-.swagger-ui-wrap table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-.swagger-ui-wrap table thead tr th {
- padding: 5px;
- font-size: 0.9em;
- color: #666666;
- border-bottom: 1px solid #999999;
-}
-.swagger-ui-wrap table tbody tr:last-child td {
- border-bottom: none;
-}
-.swagger-ui-wrap table tbody tr.offset {
- background-color: #f0f0f0;
-}
-.swagger-ui-wrap table tbody tr td {
- padding: 6px;
- font-size: 0.9em;
- border-bottom: 1px solid #cccccc;
- vertical-align: top;
- line-height: 1.3em;
-}
-.swagger-ui-wrap ol {
- margin: 0px 0 10px;
- padding: 0 0 0 18px;
- list-style-type: decimal;
-}
-.swagger-ui-wrap ol li {
- padding: 5px 0px;
- font-size: 0.9em;
- color: #333333;
-}
-.swagger-ui-wrap ol,
-.swagger-ui-wrap ul {
- list-style: none;
-}
-.swagger-ui-wrap h1 a,
-.swagger-ui-wrap h2 a,
-.swagger-ui-wrap h3 a,
-.swagger-ui-wrap h4 a,
-.swagger-ui-wrap h5 a,
-.swagger-ui-wrap h6 a {
- text-decoration: none;
-}
-.swagger-ui-wrap h1 a:hover,
-.swagger-ui-wrap h2 a:hover,
-.swagger-ui-wrap h3 a:hover,
-.swagger-ui-wrap h4 a:hover,
-.swagger-ui-wrap h5 a:hover,
-.swagger-ui-wrap h6 a:hover {
- text-decoration: underline;
-}
-.swagger-ui-wrap h1 span.divider,
-.swagger-ui-wrap h2 span.divider,
-.swagger-ui-wrap h3 span.divider,
-.swagger-ui-wrap h4 span.divider,
-.swagger-ui-wrap h5 span.divider,
-.swagger-ui-wrap h6 span.divider {
- color: #aaaaaa;
-}
-.swagger-ui-wrap a {
- color: #547f00;
-}
-.swagger-ui-wrap a img {
- border: none;
-}
-.swagger-ui-wrap article,
-.swagger-ui-wrap aside,
-.swagger-ui-wrap details,
-.swagger-ui-wrap figcaption,
-.swagger-ui-wrap figure,
-.swagger-ui-wrap footer,
-.swagger-ui-wrap header,
-.swagger-ui-wrap hgroup,
-.swagger-ui-wrap menu,
-.swagger-ui-wrap nav,
-.swagger-ui-wrap section,
-.swagger-ui-wrap summary {
- display: block;
-}
-.swagger-ui-wrap pre {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- background-color: #fcf6db;
- border: 1px solid #e5e0c6;
- padding: 10px;
-}
-.swagger-ui-wrap pre code {
- line-height: 1.6em;
- background: none;
-}
-.swagger-ui-wrap .content > .content-type > div > label {
- clear: both;
- display: block;
- color: #0F6AB4;
- font-size: 1.1em;
- margin: 0;
- padding: 15px 0 5px;
-}
-.swagger-ui-wrap .content pre {
- font-size: 12px;
- margin-top: 5px;
- padding: 5px;
-}
-.swagger-ui-wrap .icon-btn {
- cursor: pointer;
-}
-.swagger-ui-wrap .info_title {
- padding-bottom: 10px;
- font-weight: bold;
- font-size: 25px;
-}
-.swagger-ui-wrap p.big,
-.swagger-ui-wrap div.big p {
- font-size: 1em;
- margin-bottom: 10px;
-}
-.swagger-ui-wrap form.fullwidth ol li.string input,
-.swagger-ui-wrap form.fullwidth ol li.url input,
-.swagger-ui-wrap form.fullwidth ol li.text textarea,
-.swagger-ui-wrap form.fullwidth ol li.numeric input {
- width: 500px !important;
-}
-.swagger-ui-wrap .info_license {
- padding-bottom: 5px;
-}
-.swagger-ui-wrap .info_tos {
- padding-bottom: 5px;
-}
-.swagger-ui-wrap .message-fail {
- color: #cc0000;
-}
-.swagger-ui-wrap .info_contact {
- padding-bottom: 5px;
-}
-.swagger-ui-wrap .info_description {
- padding-bottom: 10px;
- font-size: 15px;
-}
-.swagger-ui-wrap .markdown ol li,
-.swagger-ui-wrap .markdown ul li {
- padding: 3px 0px;
- line-height: 1.4em;
- color: #333333;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input,
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input,
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input {
- display: block;
- padding: 4px;
- width: auto;
- clear: both;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title,
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title,
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title {
- font-size: 1.3em;
-}
-.swagger-ui-wrap table.fullwidth {
- width: 100%;
-}
-.swagger-ui-wrap .model-signature {
- font-family: "Droid Sans", sans-serif;
- font-size: 1em;
- line-height: 1.5em;
-}
-.swagger-ui-wrap .model-signature .signature-nav a {
- text-decoration: none;
- color: #AAA;
-}
-.swagger-ui-wrap .model-signature .signature-nav a:hover {
- text-decoration: underline;
- color: black;
-}
-.swagger-ui-wrap .model-signature .signature-nav .selected {
- color: black;
- text-decoration: none;
-}
-.swagger-ui-wrap .model-signature .propType {
- color: #5555aa;
-}
-.swagger-ui-wrap .model-signature pre:hover {
- background-color: #ffffdd;
-}
-.swagger-ui-wrap .model-signature pre {
- font-size: .85em;
- line-height: 1.2em;
- overflow: auto;
- max-height: 200px;
- cursor: pointer;
-}
-.swagger-ui-wrap .model-signature ul.signature-nav {
- display: block;
- margin: 0;
- padding: 0;
-}
-.swagger-ui-wrap .model-signature ul.signature-nav li:last-child {
- padding-right: 0;
- border-right: none;
-}
-.swagger-ui-wrap .model-signature ul.signature-nav li {
- float: left;
- margin: 0 5px 5px 0;
- padding: 2px 5px 2px 0;
- border-right: 1px solid #ddd;
-}
-.swagger-ui-wrap .model-signature .propOpt {
- color: #555;
-}
-.swagger-ui-wrap .model-signature .snippet small {
- font-size: 0.75em;
-}
-.swagger-ui-wrap .model-signature .propOptKey {
- font-style: italic;
-}
-.swagger-ui-wrap .model-signature .description .strong {
- font-weight: bold;
- color: #000;
- font-size: .9em;
-}
-.swagger-ui-wrap .model-signature .description div {
- font-size: 0.9em;
- line-height: 1.5em;
- margin-left: 1em;
-}
-.swagger-ui-wrap .model-signature .description .stronger {
- font-weight: bold;
- color: #000;
-}
-.swagger-ui-wrap .model-signature .propName {
- font-weight: bold;
-}
-.swagger-ui-wrap .model-signature .signature-container {
- clear: both;
-}
-.swagger-ui-wrap .body-textarea {
- width: 300px;
- height: 100px;
- border: 1px solid #aaa;
-}
-.swagger-ui-wrap .markdown p code,
-.swagger-ui-wrap .markdown li code {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- background-color: #f0f0f0;
- color: black;
- padding: 1px 3px;
-}
-.swagger-ui-wrap .required {
- font-weight: bold;
-}
-.swagger-ui-wrap input.parameter {
- width: 300px;
- border: 1px solid #aaa;
-}
-.swagger-ui-wrap h1 {
- color: black;
- font-size: 1.5em;
- line-height: 1.3em;
- padding: 10px 0 10px 0;
- font-family: "Droid Sans", sans-serif;
- font-weight: bold;
-}
-.swagger-ui-wrap .heading_with_menu {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-ui-wrap .heading_with_menu ul {
- display: block;
- clear: none;
- float: right;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -ms-box-sizing: border-box;
- box-sizing: border-box;
- margin-top: 10px;
-}
-.swagger-ui-wrap h2 {
- color: black;
- font-size: 1.3em;
- padding: 10px 0 10px 0;
-}
-.swagger-ui-wrap h2 a {
- color: black;
-}
-.swagger-ui-wrap h2 span.sub {
- font-size: 0.7em;
- color: #999999;
- font-style: italic;
-}
-.swagger-ui-wrap h2 span.sub a {
- color: #777777;
-}
-.swagger-ui-wrap span.weak {
- color: #666666;
-}
-.swagger-ui-wrap .message-success {
- color: #89BF04;
-}
-.swagger-ui-wrap caption,
-.swagger-ui-wrap th,
-.swagger-ui-wrap td {
- text-align: left;
- font-weight: normal;
- vertical-align: middle;
-}
-.swagger-ui-wrap .code {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea {
- font-family: "Droid Sans", sans-serif;
- height: 250px;
- padding: 4px;
- display: block;
- clear: both;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select {
- display: block;
- clear: both;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label {
- display: block;
- float: left;
- clear: none;
- margin: 0;
- padding: 0;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input {
- display: block;
- float: left;
- clear: none;
- margin: 0 5px 0 0;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label {
- color: black;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li label {
- display: block;
- clear: both;
- width: auto;
- padding: 0 0 3px;
- color: #666666;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr {
- padding-left: 3px;
- color: #888888;
-}
-.swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints {
- margin-left: 0;
- font-style: italic;
- font-size: 0.9em;
- margin: 0;
-}
-.swagger-ui-wrap form.formtastic fieldset.buttons {
- margin: 0;
- padding: 0;
-}
-.swagger-ui-wrap span.blank,
-.swagger-ui-wrap span.empty {
- color: #888888;
- font-style: italic;
-}
-.swagger-ui-wrap .markdown h3 {
- color: #547f00;
-}
-.swagger-ui-wrap .markdown h4 {
- color: #666666;
-}
-.swagger-ui-wrap .markdown pre {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- background-color: #fcf6db;
- border: 1px solid #e5e0c6;
- padding: 10px;
- margin: 0 0 10px 0;
-}
-.swagger-ui-wrap .markdown pre code {
- line-height: 1.6em;
-}
-.swagger-ui-wrap div.gist {
- margin: 20px 0 25px 0 !important;
-}
-.swagger-ui-wrap ul#resources {
- font-family: "Droid Sans", sans-serif;
- font-size: 0.9em;
-}
-.swagger-ui-wrap ul#resources li.resource {
- border-bottom: 1px solid #dddddd;
-}
-.swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a,
-.swagger-ui-wrap ul#resources li.resource.active div.heading h2 a {
- color: black;
-}
-.swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a,
-.swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a {
- color: #555555;
-}
-.swagger-ui-wrap ul#resources li.resource:last-child {
- border-bottom: none;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading {
- border: 1px solid transparent;
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options {
- overflow: hidden;
- padding: 0;
- display: block;
- clear: none;
- float: right;
- margin: 14px 10px 0 0;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li {
- float: left;
- clear: none;
- margin: 0;
- padding: 2px 10px;
- border-right: 1px solid #dddddd;
- color: #666666;
- font-size: 0.9em;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li a {
- color: #aaaaaa;
- text-decoration: none;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover {
- text-decoration: underline;
- color: black;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover,
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active,
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active {
- text-decoration: underline;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child,
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first {
- padding-left: 0;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child,
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last {
- padding-right: 0;
- border-right: none;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child,
-.swagger-ui-wrap ul#resources li.resource div.heading ul.options.first {
- padding-left: 0;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading h2 {
- color: #999999;
- padding-left: 0;
- display: block;
- clear: none;
- float: left;
- font-family: "Droid Sans", sans-serif;
- font-weight: bold;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading h2 a {
- color: #999999;
-}
-.swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover {
- color: black;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
- margin: 0 0 10px;
- padding: 0;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
- margin: 0;
- padding: 0;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 {
- display: block;
- clear: none;
- float: left;
- width: auto;
- margin: 0;
- padding: 0;
- line-height: 1.1em;
- color: black;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path {
- padding-left: 10px;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a {
- color: black;
- text-decoration: none;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
- text-decoration: underline;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a {
- text-transform: uppercase;
- text-decoration: none;
- color: white;
- display: inline-block;
- width: 50px;
- font-size: 0.7em;
- text-align: center;
- padding: 7px 0 4px;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- -o-border-radius: 2px;
- -ms-border-radius: 2px;
- -khtml-border-radius: 2px;
- border-radius: 2px;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span {
- margin: 0;
- padding: 0;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options {
- overflow: hidden;
- padding: 0;
- display: block;
- clear: none;
- float: right;
- margin: 6px 10px 0 0;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li {
- float: left;
- clear: none;
- margin: 0;
- padding: 2px 10px;
- font-size: 0.9em;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
- text-decoration: none;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
- border-top: none;
- padding: 10px;
- -moz-border-radius-bottomleft: 6px;
- -webkit-border-bottom-left-radius: 6px;
- -o-border-bottom-left-radius: 6px;
- -ms-border-bottom-left-radius: 6px;
- -khtml-border-bottom-left-radius: 6px;
- border-bottom-left-radius: 6px;
- -moz-border-radius-bottomright: 6px;
- -webkit-border-bottom-right-radius: 6px;
- -o-border-bottom-right-radius: 6px;
- -ms-border-bottom-right-radius: 6px;
- -khtml-border-bottom-right-radius: 6px;
- border-bottom-right-radius: 6px;
- margin: 0 0 20px;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 {
- font-size: 1.1em;
- margin: 0;
- padding: 15px 0 5px;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header {
- float: none;
- clear: both;
- overflow: hidden;
- display: block;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a {
- padding: 4px 0 0 10px;
- display: inline-block;
- font-size: 0.9em;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header img {
- display: block;
- clear: none;
- float: right;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit {
- display: block;
- clear: none;
- float: left;
- padding: 6px 8px;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error {
- outline: 2px solid black;
- outline-color: #cc0000;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
- font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
- padding: 10px;
- font-size: 0.9em;
- max-height: 400px;
- overflow-y: auto;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading {
- background-color: #f9f2e9;
- border: 1px solid #f0e0ca;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a {
- background-color: #c5862b;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #f0e0ca;
- color: #c5862b;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a {
- color: #c5862b;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content {
- background-color: #faf5ee;
- border: 1px solid #f0e0ca;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 {
- color: #c5862b;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a {
- color: #dcb67f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading {
- background-color: #fcffcd;
- border: 1px solid black;
- border-color: #ffd20f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a {
- text-transform: uppercase;
- background-color: #ffd20f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #ffd20f;
- color: #ffd20f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a {
- color: #ffd20f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content {
- background-color: #fcffcd;
- border: 1px solid black;
- border-color: #ffd20f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 {
- color: #ffd20f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a {
- color: #6fc992;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading {
- background-color: #f5e8e8;
- border: 1px solid #e8c6c7;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a {
- text-transform: uppercase;
- background-color: #a41e22;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #e8c6c7;
- color: #a41e22;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a {
- color: #a41e22;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
- background-color: #f7eded;
- border: 1px solid #e8c6c7;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 {
- color: #a41e22;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a {
- color: #c8787a;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading {
- background-color: #e7f6ec;
- border: 1px solid #c3e8d1;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a {
- background-color: #10a54a;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #c3e8d1;
- color: #10a54a;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a {
- color: #10a54a;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content {
- background-color: #ebf7f0;
- border: 1px solid #c3e8d1;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 {
- color: #10a54a;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a {
- color: #6fc992;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading {
- background-color: #FCE9E3;
- border: 1px solid #F5D5C3;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a {
- background-color: #D38042;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #f0cecb;
- color: #D38042;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a {
- color: #D38042;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content {
- background-color: #faf0ef;
- border: 1px solid #f0cecb;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 {
- color: #D38042;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a {
- color: #dcb67f;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading {
- background-color: #e7f0f7;
- border: 1px solid #c3d9ec;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a {
- background-color: #0f6ab4;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li {
- border-right: 1px solid #dddddd;
- border-right-color: #c3d9ec;
- color: #0f6ab4;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a {
- color: #0f6ab4;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content {
- background-color: #ebf3f9;
- border: 1px solid #c3d9ec;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 {
- color: #0f6ab4;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a {
- color: #6fa5d2;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content {
- border-top: none;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last {
- padding-right: 0;
- border-right: none;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active {
- text-decoration: underline;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first {
- padding-left: 0;
-}
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child,
-.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first {
- padding-left: 0;
-}
-.swagger-ui-wrap p#colophon {
- margin: 0 15px 40px 15px;
- padding: 10px 0;
- font-size: 0.8em;
- border-top: 1px solid #dddddd;
- font-family: "Droid Sans", sans-serif;
- color: #999999;
- font-style: italic;
-}
-.swagger-ui-wrap p#colophon a {
- text-decoration: none;
- color: #547f00;
-}
-.swagger-ui-wrap h3 {
- color: black;
- font-size: 1.1em;
- padding: 10px 0 10px 0;
-}
-.swagger-ui-wrap .markdown ol,
-.swagger-ui-wrap .markdown ul {
- font-family: "Droid Sans", sans-serif;
- margin: 5px 0 10px;
- padding: 0 0 0 18px;
- list-style-type: disc;
-}
-.swagger-ui-wrap form.form_box {
- background-color: #ebf3f9;
- border: 1px solid #c3d9ec;
- padding: 10px;
-}
-.swagger-ui-wrap form.form_box label {
- color: #0f6ab4 !important;
-}
-.swagger-ui-wrap form.form_box input[type=submit] {
- display: block;
- padding: 10px;
-}
-.swagger-ui-wrap form.form_box p.weak {
- font-size: 0.8em;
-}
-.swagger-ui-wrap form.form_box p {
- font-size: 0.9em;
- padding: 0 0 15px;
- color: #7e7b6d;
-}
-.swagger-ui-wrap form.form_box p a {
- color: #646257;
-}
-.swagger-ui-wrap form.form_box p strong {
- color: black;
-}
-#header {
- background-color: #89bf04;
- padding: 14px;
-}
-#header a#logo {
- font-size: 1.5em;
- font-weight: bold;
- text-decoration: none;
- background: transparent url(../images/logo_small.png) no-repeat left center;
- padding: 20px 0 20px 40px;
- color: white;
-}
-#header form#api_selector {
- display: block;
- clear: none;
- float: right;
-}
-#header form#api_selector .input {
- display: block;
- clear: none;
- float: left;
- margin: 0 10px 0 0;
-}
-#header form#api_selector .input input#input_apiKey {
- width: 200px;
-}
-#header form#api_selector .input input#input_baseUrl {
- width: 400px;
-}
-#header form#api_selector .input a#explore {
- display: block;
- text-decoration: none;
- font-weight: bold;
- padding: 6px 8px;
- font-size: 0.9em;
- color: white;
- background-color: #547f00;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- -o-border-radius: 4px;
- -ms-border-radius: 4px;
- -khtml-border-radius: 4px;
- border-radius: 4px;
-}
-#header form#api_selector .input a#explore:hover {
- background-color: #547f00;
-}
-#header form#api_selector .input input {
- font-size: 0.9em;
- padding: 3px;
- margin: 0;
-}
-#content_message {
- margin: 10px 15px;
- font-style: italic;
- color: #999999;
-}
-#message-bar {
- min-height: 30px;
- text-align: center;
- padding-top: 10px;
-}
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/images/logo_small.png b/fixtures/v1.2/helloworld/server/src/main/webapp/images/logo_small.png
deleted file mode 100644
index 5496a65579..0000000000
Binary files a/fixtures/v1.2/helloworld/server/src/main/webapp/images/logo_small.png and /dev/null differ
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/images/pet_store_api.png b/fixtures/v1.2/helloworld/server/src/main/webapp/images/pet_store_api.png
deleted file mode 100644
index f9f9cd4aeb..0000000000
Binary files a/fixtures/v1.2/helloworld/server/src/main/webapp/images/pet_store_api.png and /dev/null differ
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/images/throbber.gif b/fixtures/v1.2/helloworld/server/src/main/webapp/images/throbber.gif
deleted file mode 100644
index 0639388924..0000000000
Binary files a/fixtures/v1.2/helloworld/server/src/main/webapp/images/throbber.gif and /dev/null differ
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/images/wordnik_api.png b/fixtures/v1.2/helloworld/server/src/main/webapp/images/wordnik_api.png
deleted file mode 100644
index dca4f1455a..0000000000
Binary files a/fixtures/v1.2/helloworld/server/src/main/webapp/images/wordnik_api.png and /dev/null differ
diff --git a/fixtures/v1.2/helloworld/server/src/main/webapp/index.html b/fixtures/v1.2/helloworld/server/src/main/webapp/index.html
deleted file mode 100644
index 44cc371783..0000000000
--- a/fixtures/v1.2/helloworld/server/src/main/webapp/index.html
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
- Swagger UI
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
`;
+ preface += 'The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.';
+ preface += '';
+ preface += '';
+ preface += '
Status of This Document
';
+ preface += 'The source-of-truth for the specification is the GitHub markdown file referenced above.';
+ preface += '';
+ }
+ else {
+ preface += '';
+ }
+ return preface;
+}
+
+function doMaintainers() {
+ let m = fs.readFileSync(argv.maintainers,'utf8');
+ let h = md.render(m);
+ let $ = cheerio.load(h);
+ let u = $('ul').first();
+ $(u).children('li').each(function(e){
+ let t = $(this).text().split('@')[0];
+ maintainers.push({name:t});
+ });
+ if ($("ul").length < 2) return;
+ u = $("ul").last();
+ $(u).children('li').each(function(e){
+ let t = $(this).text().split('@')[0];
+ emeritus.push({name:t});
+ });
+}
+
+function getPublishDate(m) {
+ let result = new Date();
+ let h = md.render(m);
+ let $ = cheerio.load(h);
+ $('table').each(function(i,table){
+ const h = $(table).find('th');
+ const headers = [];
+ $(h).each(function(i,header){
+ headers.push($(header).text());
+ });
+ if (headers.length >= 2 && headers[0] === 'Version' && headers[1] === 'Date') {
+ let c = $(table).find('tr').find('td');
+ let v = $(c[0]).text();
+ let d = $(c[1]).text();
+ argv.subtitle = v;
+ if (d !== 'TBA') result = new Date(d);
+ }
+ });
+ return result;
+}
+
+if (argv.maintainers) {
+ doMaintainers();
+}
+
+let s = fs.readFileSync(argv._[0],'utf8');
+
+if (argv.respec) {
+ argv.publishDate = getPublishDate(s);
+}
+
+let lines = s.split('\r').join().split('\n');
+
+let prevHeading = 0;
+let lastIndent = 0;
+let inTOC = false;
+let inDefs = false;
+let inCodeBlock = false;
+let bsFix = true;
+
+let indents = [0];
+
+// process the markdown
+for (let l in lines) {
+ let line = lines[l];
+ let linkTarget;
+
+ if (line.startsWith('## Table of Contents')) inTOC = true;
+ if (line.startsWith('
- [Definitions](#definitions)
- - [OpenAPI Document](#oasDocument)
- - [Path Templating](#pathTemplating)
- - [Media Types](#mediaTypes)
- - [HTTP Status Codes](#httpCodes)
+ - [OpenAPI Document](#openapi-document)
+ - [Path Templating](#path-templating)
+ - [Media Types](#media-types)
+ - [HTTP Status Codes](#http-status-codes)
- [Specification](#specification)
- [Versions](#versions)
- [Format](#format)
- - [Document Structure](#documentStructure)
- - [Data Types](#dataTypes)
- - [Rich Text Formatting](#richText)
- - [Relative References In URLs](#relativeReferences)
+ - [Document Structure](#document-structure)
+ - [Data Types](#data-types)
+ - [Rich Text Formatting](#rich-text-formatting)
+ - [Relative References In URLs](#relative-references-in-urls)
- [Schema](#schema)
- - [OpenAPI Object](#oasObject)
- - [Info Object](#infoObject)
- - [Contact Object](#contactObject)
- - [License Object](#licenseObject)
- - [Server Object](#serverObject)
- - [Server Variable Object](#serverVariableObject)
- - [Components Object](#componentsObject)
- - [Paths Object](#pathsObject)
- - [Path Item Object](#pathItemObject)
- - [Operation Object](#operationObject)
- - [External Documentation Object](#externalDocumentationObject)
- - [Parameter Object](#parameterObject)
- - [Request Body Object](#requestBodyObject)
- - [Media Type Object](#mediaTypeObject)
- - [Encoding Object](#encodingObject)
- - [Responses Object](#responsesObject)
- - [Response Object](#responseObject)
- - [Callback Object](#callbackObject)
- - [Example Object](#exampleObject)
- - [Link Object](#linkObject)
- - [Header Object](#headerObject)
- - [Tag Object](#tagObject)
- - [Reference Object](#referenceObject)
- - [Schema Object](#schemaObject)
- - [Discriminator Object](#discriminatorObject)
- - [XML Object](#xmlObject)
- - [Security Scheme Object](#securitySchemeObject)
- - [OAuth Flows Object](#oauthFlowsObject)
- - [OAuth Flow Object](#oauthFlowObject)
- - [Security Requirement Object](#securityRequirementObject)
- - [Specification Extensions](#specificationExtensions)
- - [Security Filtering](#securityFiltering)
-- [Appendix A: Revision History](#revisionHistory)
+ - [OpenAPI Object](#openapi-object)
+ - [Info Object](#info-object)
+ - [Contact Object](#contact-object)
+ - [License Object](#license-object)
+ - [Server Object](#server-object)
+ - [Server Variable Object](#server-variable-object)
+ - [Components Object](#components-object)
+ - [Paths Object](#paths-object)
+ - [Path Item Object](#path-item-object)
+ - [Operation Object](#operation-object)
+ - [External Documentation Object](#external-documentation-object)
+ - [Parameter Object](#parameter-object)
+ - [Request Body Object](#request-body-object)
+ - [Media Type Object](#media-type-object)
+ - [Encoding Object](#encoding-object)
+ - [Responses Object](#responses-object)
+ - [Response Object](#response-object)
+ - [Callback Object](#callback-object)
+ - [Example Object](#example-object)
+ - [Link Object](#link-object)
+ - [Header Object](#header-object)
+ - [Tag Object](#tag-object)
+ - [Reference Object](#reference-object)
+ - [Schema Object](#schema-object)
+ - [Discriminator Object](#discriminator-object)
+ - [XML Object](#xml-object)
+ - [Security Scheme Object](#security-scheme-object)
+ - [OAuth Flows Object](#oauth-flows-object)
+ - [OAuth Flow Object](#oauth-flow-object)
+ - [Security Requirement Object](#security-requirement-object)
+ - [Specification Extensions](#specification-extensions)
+ - [Security Filtering](#security-filtering)
+- [Appendix A: Revision History](#appendix-a-revision-history)
## Definitions
-##### OpenAPI Document
+##### OpenAPI Document
A document (or set of documents) that defines or describes an API. An OpenAPI definition uses and conforms to the OpenAPI Specification.
-##### Path Templating
+##### Path Templating
Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.
-##### Media Types
+##### Media Types
Media type definitions are spread across several resources.
The media type definitions SHOULD be in compliance with [RFC6838](http://tools.ietf.org/html/rfc6838).
@@ -90,8 +90,8 @@ Some examples of possible media type definitions:
application/vnd.github.v3.diff
application/vnd.github.v3.patch
```
-##### HTTP Status Codes
-The HTTP Status Codes are used to indicate the status of the executed operation.
+##### HTTP Status Codes
+The HTTP Status Codes are used to indicate the status of the executed operation.
The available status codes are defined by [RFC7231](http://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
## Specification
@@ -121,7 +121,7 @@ All field names in the specification are **case sensitive**.
The schema exposes two types of fields: Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name.
-Patterned fields MUST have unique names within the containing object.
+Patterned fields MUST have unique names within the containing object.
In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](http://www.yaml.org/spec/1.2/spec.html) is RECOMMENDED along with some additional constraints:
@@ -130,18 +130,18 @@ In order to preserve the ability to round-trip between YAML and JSON formats, YA
**Note:** While APIs may be defined by OpenAPI documents in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
-### Document Structure
+### Document Structure
An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the user. In the latter case, `$ref` fields MUST be used in the specification to reference those parts as follows from the [JSON Schema](http://json-schema.org) definitions.
It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `openapi.yaml`.
-### Data Types
+### Data Types
-Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
-Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
+Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
+Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
`null` is not supported as a type (see [`nullable`](#schemaNullable) for an alternative solution).
-Models are defined using the [Schema Object](#schemaObject), which is an extended subset of JSON Schema Specification Wright Draft 00.
+Models are defined using the [Schema Object](#schema-object), which is an extended subset of JSON Schema Specification Wright Draft 00.
Primitives have an optional modifier property: `format`.
OAS uses several known formats to define in fine detail the data type being used.
@@ -151,7 +151,7 @@ Types that are not accompanied by a `format` property follow the type definition
The formats defined by the OAS are:
-Common Name | [`type`](#dataTypes) | [`format`](#dataTypeFormat) | Comments
+Common Name | [`type`](#data-types) | [`format`](#dataTypeFormat) | Comments
----------- | ------ | -------- | --------
integer | `integer` | `int32` | signed 32 bits
long | `integer` | `int64` | signed 64 bits
@@ -161,45 +161,45 @@ string | `string` | | |
byte | `string` | `byte` | base64 encoded characters
binary | `string` | `binary` | any sequence of octets
boolean | `boolean` | | |
-date | `string` | `date` | As defined by `full-date` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
-dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
+date | `string` | `date` | As defined by `full-date` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
+dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
password | `string` | `password` | A hint to UIs to obscure input.
-### Rich Text Formatting
+### Rich Text Formatting
Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
-Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](http://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
+Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](http://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
-### Relative References in URLs
+### Relative References in URLs
Unless specified otherwise, all properties that are URLs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
-Relative references are resolved using the URLs defined in the [`Server Object`](#serverObject) as a Base URI.
+Relative references are resolved using the URLs defined in the [`Server Object`](#server-object) as a Base URI.
-Relative references used in `$ref` are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), using the URL of the current document as the base URI. See also the [Reference Object](#referenceObject).
+Relative references used in `$ref` are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), using the URL of the current document as the base URI. See also the [Reference Object](#reference-object).
### Schema
In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
-#### OpenAPI Object
+#### OpenAPI Object
-This is the root document object of the [OpenAPI document](#oasDocument).
+This is the root document object of the [OpenAPI document](#openapi-document).
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
openapi | `string` | **REQUIRED**. This string MUST be the [semantic version number](http://semver.org/spec/v2.0.0.html) of the [OpenAPI Specification version](#versions) that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is *not* related to the API [`info.version`](#infoVersion) string.
-info | [Info Object](#infoObject) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
-servers | [[Server Object](#serverObject)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#serverObject) with a [url](#serverUrl) value of `/`.
-paths | [Paths Object](#pathsObject) | **REQUIRED**. The available paths and operations for the API.
-components | [Components Object](#componentsObject) | An element to hold various schemas for the specification.
-security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
-tags | [[Tag Object](#tagObject)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operationObject) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
-externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation.
+info | [Info Object](#info-object) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
+servers | [[Server Object](#server-object)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#serverUrl) value of `/`.
+paths | [Paths Object](#paths-object) | **REQUIRED**. The available paths and operations for the API.
+components | [Components Object](#components-object) | An element to hold various schemas for the specification.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
+tags | [[Tag Object](#tag-object)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operation-object) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
-#### Info Object
+#### Info Object
The object provides metadata about the API.
The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
@@ -211,12 +211,12 @@ Field Name | Type | Description
title | `string` | **REQUIRED**. The title of the application.
description | `string` | A short description of the application. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
-contact | [Contact Object](#contactObject) | The contact information for the exposed API.
-license | [License Object](#licenseObject) | The license information for the exposed API.
+contact | [Contact Object](#contact-object) | The contact information for the exposed API.
+license | [License Object](#license-object) | The license information for the exposed API.
version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Info Object Example:
@@ -252,7 +252,7 @@ license:
version: 1.0.1
```
-#### Contact Object
+#### Contact Object
Contact information for the exposed API.
@@ -264,7 +264,7 @@ Field Name | Type | Description
url | `string` | The URL pointing to the contact information. MUST be in the format of a URL.
email | `string` | The email address of the contact person/organization. MUST be in the format of an email address.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Contact Object Example:
@@ -282,7 +282,7 @@ url: http://www.example.com/support
email: support@example.com
```
-#### License Object
+#### License Object
License information for the exposed API.
@@ -293,7 +293,7 @@ Field Name | Type | Description
name | `string` | **REQUIRED**. The license name used for the API.
url | `string` | A URL to the license used for the API. MUST be in the format of a URL.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### License Object Example:
@@ -309,7 +309,7 @@ name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
```
-#### Server Object
+#### Server Object
An object representing a Server.
@@ -319,9 +319,9 @@ Field Name | Type | Description
---|:---:|---
url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-variables | Map[`string`, [Server Variable Object](#serverVariableObject)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
+variables | Map[`string`, [Server Variable Object](#server-variable-object)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Server Object Example
@@ -419,7 +419,7 @@ servers:
```
-#### Server Variable Object
+#### Server Variable Object
An object representing a Server Variable for server URL template substitution.
@@ -428,12 +428,12 @@ An object representing a Server Variable for server URL template substitution.
Field Name | Type | Description
---|:---:|---
enum | [`string`] | An enumeration of string values to be used if the substitution options are from a limited set.
-default | `string` | **REQUIRED**. The default value to use for substitution, and to send, if an alternate value is _not_ supplied. Unlike the [Schema Object's](#schemaObject) `default`, this value MUST be provided by the consumer.
+default | `string` | **REQUIRED**. The default value to use for substitution, and to send, if an alternate value is _not_ supplied. Unlike the [Schema Object's](#schema-object) `default`, this value MUST be provided by the consumer.
description | `string` | An optional description for the server variable. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
-#### Components Object
+#### Components Object
Holds a set of reusable objects for different aspects of the OAS.
All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
@@ -443,17 +443,17 @@ All objects defined within the components object will have no effect on the API
Field Name | Type | Description
---|:---|---
- schemas | Map[`string`, [Schema Object](#schemaObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Schema Objects](#schemaObject).
- responses | Map[`string`, [Response Object](#responseObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Response Objects](#responseObject).
- parameters | Map[`string`, [Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Parameter Objects](#parameterObject).
- examples | Map[`string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Example Objects](#exampleObject).
- requestBodies | Map[`string`, [Request Body Object](#requestBodyObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Request Body Objects](#requestBodyObject).
- headers | Map[`string`, [Header Object](#headerObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Header Objects](#headerObject).
- securitySchemes| Map[`string`, [Security Scheme Object](#securitySchemeObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Security Scheme Objects](#securitySchemeObject).
- links | Map[`string`, [Link Object](#linkObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Link Objects](#linkObject).
- callbacks | Map[`string`, [Callback Object](#callbackObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Callback Objects](#callbackObject).
-
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+ schemas | Map[`string`, [Schema Object](#schema-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Schema Objects](#schema-object).
+ responses | Map[`string`, [Response Object](#response-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Response Objects](#response-object).
+ parameters | Map[`string`, [Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Parameter Objects](#parameter-object).
+ examples | Map[`string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Example Objects](#example-object).
+ requestBodies | Map[`string`, [Request Body Object](#request-body-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Request Body Objects](#request-body-object).
+ headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Header Objects](#header-object).
+ securitySchemes| Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object).
+ links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Link Objects](#link-object).
+ callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Callback Objects](#callback-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`.
@@ -613,7 +613,7 @@ components:
in: header
petstore_auth:
type: oauth2
- flows:
+ flows:
implicit:
authorizationUrl: http://example.org/api/oauth/dialog
scopes:
@@ -622,18 +622,18 @@ components:
```
-#### Paths Object
+#### Paths Object
Holds the relative paths to the individual endpoints and their operations.
-The path is appended to the URL from the [`Server Object`](#serverObject) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#securityFiltering).
+The path is appended to the URL from the [`Server Object`](#server-object) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#security-filtering).
##### Patterned Fields
Field Pattern | Type | Description
---|:---:|---
-/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#serverObject)'s `url` field in order to construct the full URL. [Path templating](#pathTemplating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
+/{path} | [Path Item Object](#path-item-object) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#server-object)'s `url` field in order to construct the full URL. [Path templating](#path-templating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Path Templating Matching
@@ -666,7 +666,7 @@ The following may lead to ambiguous resolution:
"get": {
"description": "Returns all pets from the system that the user has access to",
"responses": {
- "200": {
+ "200": {
"description": "A list of pets.",
"content": {
"application/json": {
@@ -700,32 +700,32 @@ The following may lead to ambiguous resolution:
$ref: '#/components/schemas/pet'
```
-#### Path Item Object
+#### Path Item Object
Describes the operations available on a single path.
-A Path Item MAY be empty, due to [ACL constraints](#securityFiltering).
+A Path Item MAY be empty, due to [ACL constraints](#security-filtering).
The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
-$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#pathItemObject). If there are conflicts between the referenced definition and this Path Item's definition, the behavior is *undefined*.
+$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#path-item-object). If there are conflicts between the referenced definition and this Path Item's definition, the behavior is *undefined*.
summary| `string` | An optional, string summary, intended to apply to all operations in this path.
description | `string` | An optional, string description, intended to apply to all operations in this path. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-get | [Operation Object](#operationObject) | A definition of a GET operation on this path.
-put | [Operation Object](#operationObject) | A definition of a PUT operation on this path.
-post | [Operation Object](#operationObject) | A definition of a POST operation on this path.
-delete | [Operation Object](#operationObject) | A definition of a DELETE operation on this path.
-options | [Operation Object](#operationObject) | A definition of a OPTIONS operation on this path.
-head | [Operation Object](#operationObject) | A definition of a HEAD operation on this path.
-patch | [Operation Object](#operationObject) | A definition of a PATCH operation on this path.
-trace | [Operation Object](#operationObject) | A definition of a TRACE operation on this path.
-servers | [[Server Object](#serverObject)] | An alternative `server` array to service all operations in this path.
-parameters | [[Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+get | [Operation Object](#operation-object) | A definition of a GET operation on this path.
+put | [Operation Object](#operation-object) | A definition of a PUT operation on this path.
+post | [Operation Object](#operation-object) | A definition of a POST operation on this path.
+delete | [Operation Object](#operation-object) | A definition of a DELETE operation on this path.
+options | [Operation Object](#operation-object) | A definition of a OPTIONS operation on this path.
+head | [Operation Object](#operation-object) | A definition of a HEAD operation on this path.
+patch | [Operation Object](#operation-object) | A definition of a PATCH operation on this path.
+trace | [Operation Object](#operation-object) | A definition of a TRACE operation on this path.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service all operations in this path.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Path Item Object Example
@@ -808,10 +808,10 @@ parameters:
type: array
style: simple
items:
- type: string
+ type: string
```
-#### Operation Object
+#### Operation Object
Describes a single API operation on a path.
@@ -822,17 +822,17 @@ Field Name | Type | Description
tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
summary | `string` | A short summary of what the operation does.
description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this operation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this operation.
operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
-parameters | [[Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
-requestBody | [Request Body Object](#requestBodyObject) \| [Reference Object](#referenceObject) | The request body applicable for this operation. The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, `requestBody` SHALL be ignored by consumers.
-responses | [Responses Object](#responsesObject) | **REQUIRED**. The list of possible responses as they are returned from executing this operation.
-callbacks | Map[`string`, [Callback Object](#callbackObject) \| [Reference Object](#referenceObject)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callbackObject) that describes a request that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+requestBody | [Request Body Object](#request-body-object) \| [Reference Object](#reference-object) | The request body applicable for this operation. The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, `requestBody` SHALL be ignored by consumers.
+responses | [Responses Object](#responses-object) | **REQUIRED**. The list of possible responses as they are returned from executing this operation.
+callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callback-object) that describes a request that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
-security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
-servers | [[Server Object](#serverObject)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Operation Object Example
@@ -860,7 +860,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
"schema": {
"type": "object",
"properties": {
- "name": {
+ "name": {
"description": "Updated name of the pet",
"type": "string"
},
@@ -869,7 +869,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
"type": "string"
}
},
- "required": ["status"]
+ "required": ["status"]
}
}
}
@@ -918,7 +918,7 @@ requestBody:
'application/x-www-form-urlencoded':
schema:
properties:
- name:
+ name:
description: Updated name of the pet
type: string
status:
@@ -929,12 +929,12 @@ requestBody:
responses:
'200':
description: Pet updated.
- content:
+ content:
'application/json': {}
'application/xml': {}
'405':
description: Invalid input
- content:
+ content:
'application/json': {}
'application/xml': {}
security:
@@ -944,7 +944,7 @@ security:
```
-#### External Documentation Object
+#### External Documentation Object
Allows referencing an external resource for extended documentation.
@@ -955,7 +955,7 @@ Field Name | Type | Description
description | `string` | A short description of the target documentation. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
url | `string` | **REQUIRED**. The URL for the target documentation. Value MUST be in the format of a URL.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### External Documentation Object Example
@@ -971,7 +971,7 @@ description: Find more info here
url: https://example.com
```
-#### Parameter Object
+#### Parameter Object
Describes a single operation parameter.
@@ -979,7 +979,7 @@ A unique parameter is defined by a combination of a [name](#parameterName) and [
##### Parameter Locations
There are four possible parameter locations specified by the `in` field:
-* path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
+* path - Used together with [Path Templating](#path-templating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
* header - Custom headers that are expected as part of the request. Note that [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive.
* cookie - Used to pass a specific cookie value to the API.
@@ -988,7 +988,7 @@ There are four possible parameter locations specified by the `in` field:
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
-name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*.
If [`in`](#parameterIn) is `"path"`, the `name` field MUST correspond to the associated path segment from the [path](#pathsPath) field in the [Paths Object](#pathsObject). See [Path Templating](#pathTemplating) for further information.
If [`in`](#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
For all other cases, the `name` corresponds to the parameter name used by the [`in`](#parameterIn) property.
+name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*.
If [`in`](#parameterIn) is `"path"`, the `name` field MUST correspond to the associated path segment from the [path](#pathsPath) field in the [Paths Object](#paths-object). See [Path Templating](#path-templating) for further information.
If [`in`](#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
For all other cases, the `name` corresponds to the parameter name used by the [`in`](#parameterIn) property.
in | `string` | **REQUIRED**. The location of the parameter. Possible values are "query", "header", "path" or "cookie".
description | `string` | A brief description of the parameter. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
required | `boolean` | Determines whether this parameter is mandatory. If the [parameter location](#parameterIn) is "path", this property is **REQUIRED** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
@@ -1003,9 +1003,9 @@ Field Name | Type | Description
style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When [`style`](#parameterStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`.
allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
-schema | [Schema Object](#schemaObject) \| [Reference Object](#referenceObject) | The schema defining the type used for the parameter.
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the type used for the parameter.
example | Any | Example of the media type. The example SHOULD match the specified schema and encoding properties if present. The `example` object is mutually exclusive of the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
-examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the media type. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` object is mutually exclusive of the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` object is mutually exclusive of the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter.
A parameter MUST contain either a `schema` property, or a `content` property, but not both.
@@ -1014,19 +1014,19 @@ When `example` or `examples` are provided in conjunction with the `schema` objec
Field Name | Type | Description
---|:---:|---
-content | Map[`string`, [Media Type Object](#mediaTypeObject)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
##### Style Values
In order to support common ways of serializing simple parameters, a set of `style` values are defined.
-`style` | [`type`](#dataTypes) | `in` | Comments
+`style` | [`type`](#data-types) | `in` | Comments
----------- | ------ | -------- | --------
-matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
+matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` with a `csv` (when `explode` is false) or `multi` (when `explode` is true) value from OpenAPI 2.0.
simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2). This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0.
-spaceDelimited | `array` | `query` | Space separated array values. This option replaces `collectionFormat` equal to `ssv` from OpenAPI 2.0.
+spaceDelimited | `array` | `query` | Space separated array values. This option replaces `collectionFormat` equal to `ssv` from OpenAPI 2.0.
pipeDelimited | `array` | `query` | Pipe separated array values. This option replaces `collectionFormat` equal to `pipes` from OpenAPI 2.0.
deepObject | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
@@ -1056,7 +1056,7 @@ spaceDelimited | false | n/a | n/a | blue%20black%20brown | R%20100%20G%20200%20
pipeDelimited | false | n/a | n/a | blue\|black\|brown | R\|100\|G\|200|G\|150
deepObject | true | n/a | n/a | n/a | color[R]=100&color[G]=200&color[B]=150
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Parameter Object Examples
@@ -1215,7 +1215,7 @@ content:
type: number
```
-#### Request Body Object
+#### Request Body Object
Describes a single request body.
@@ -1223,11 +1223,11 @@ Describes a single request body.
Field Name | Type | Description
---|:---:|---
description | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-content | Map[`string`, [Media Type Object](#mediaTypeObject)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+content | Map[`string`, [Media Type Object](#media-type-object)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
required | `boolean` | Determines if the request body is required in the request. Defaults to `false`.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Request Body Examples
@@ -1242,9 +1242,9 @@ A request body with a referenced model definition.
},
"examples": {
"user" : {
- "summary": "User Example",
+ "summary": "User Example",
"externalValue": "http://foo.bar/examples/user-example.json"
- }
+ }
}
},
"application/xml": {
@@ -1262,9 +1262,9 @@ A request body with a referenced model definition.
"examples": {
"user" : {
"summary": "User example in Plain text",
- "externalValue": "http://foo.bar/examples/user-example.txt"
+ "externalValue": "http://foo.bar/examples/user-example.txt"
}
- }
+ }
},
"*/*": {
"examples": {
@@ -1280,7 +1280,7 @@ A request body with a referenced model definition.
```yaml
description: user to add to the system
-content:
+content:
'application/json':
schema:
$ref: '#/components/schemas/User'
@@ -1302,7 +1302,7 @@ content:
externalValue: 'http://foo.bar/examples/user-example.txt'
'*/*':
examples:
- user:
+ user:
summary: User example in other format
externalValue: 'http://foo.bar/examples/user-example.whatever'
```
@@ -1336,18 +1336,18 @@ content:
```
-#### Media Type Object
+#### Media Type Object
Each Media Type Object provides schema and examples for the media type identified by its key.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
-schema | [Schema Object](#schemaObject) \| [Reference Object](#referenceObject) | The schema defining the type used for the request body.
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the type used for the request body.
example | Any | Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` object is mutually exclusive of the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema.
-examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` object is mutually exclusive of the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
-encoding | Map[`string`, [Encoding Object](#encodingObject)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` object is mutually exclusive of the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+encoding | Map[`string`, [Encoding Object](#encoding-object)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Media Type Examples
@@ -1360,7 +1360,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
"examples": {
"cat" : {
"summary": "An example of a cat",
- "value":
+ "value":
{
"name": "Fluffy",
"petType": "Cat",
@@ -1371,7 +1371,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
},
"dog": {
"summary": "An example of a dog with a cat's name",
- "value" : {
+ "value" : {
"name": "Puma",
"petType": "Dog",
"color": "Black",
@@ -1388,7 +1388,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
```
```yaml
-application/json:
+application/json:
schema:
$ref: "#/components/schemas/Pet"
examples:
@@ -1459,7 +1459,7 @@ requestBody:
'image/png':
schema:
type: string
- format: binary
+ format: binary
```
To upload multiple files, a `multipart` media type MUST be used:
@@ -1502,7 +1502,7 @@ requestBody:
In this example, the contents in the `requestBody` MUST be stringified per [RFC1866](https://tools.ietf.org/html/rfc1866/) when passed to the server. In addition, the `address` field complex object will be stringified.
-When passing complex objects in the `application/x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the [`Encoding Object`](#encodingObject)'s [`style`](#encodingStyle) property as `form`.
+When passing complex objects in the `application/x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the [`Encoding Object`](#encoding-object)'s [`style`](#encodingStyle) property as `form`.
##### Special Considerations for `multipart` Content
@@ -1549,7 +1549,7 @@ requestBody:
An `encoding` attribute is introduced to give you control over the serialization of parts of `multipart` request bodies. This attribute is _only_ applicable to `multipart` and `application/x-www-form-urlencoded` request bodies.
-#### Encoding Object
+#### Encoding Object
A single encoding definition applied to a single schema property.
@@ -1557,12 +1557,12 @@ A single encoding definition applied to a single schema property.
Field Name | Type | Description
---|:---:|---
contentType | `string` | The Content-Type for encoding a specific property. Default value depends on the property type: for `string` with `format` being `binary` – `application/octet-stream`; for other primitive types – `text/plain`; for `object` - `application/json`; for `array` – the default is defined based on the inner type. The value can be a specific media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`), or a comma-separated list of the two types.
-headers | Map[`string`, [Header Object](#headerObject) \| [Reference Object](#referenceObject)] | A map allowing additional information to be provided as headers, for example `Content-Disposition`. `Content-Type` is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a `multipart`.
-style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameterObject) for details on the [`style`](#parameterStyle) property. The behavior follows the same values as `query` parameters, including default values. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | A map allowing additional information to be provided as headers, for example `Content-Disposition`. `Content-Type` is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a `multipart`.
+style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameter-object) for details on the [`style`](#parameterStyle) property. The behavior follows the same values as `query` parameters, including default values. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
explode | `boolean` | When this is true, property values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When [`style`](#encodingStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Encoding Object Example
@@ -1604,7 +1604,7 @@ requestBody:
type: integer
```
-#### Responses Object
+#### Responses Object
A container for the expected responses of an operation.
The container maps a HTTP response code to the expected response.
@@ -1612,24 +1612,24 @@ The container maps a HTTP response code to the expected response.
The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance.
However, documentation is expected to cover a successful operation response and any known errors.
-The `default` MAY be used as a default response object for all HTTP codes
+The `default` MAY be used as a default response object for all HTTP codes
that are not covered individually by the specification.
-The `Responses Object` MUST contain at least one response code, and it
+The `Responses Object` MUST contain at least one response code, and it
SHOULD be the response for a successful operation call.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
-default | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. A [Reference Object](#referenceObject) can link to a response that the [OpenAPI Object's components/responses](#componentsResponses) section defines.
+default | [Response Object](#response-object) \| [Reference Object](#reference-object) | The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. A [Reference Object](#reference-object) can link to a response that the [OpenAPI Object's components/responses](#componentsResponses) section defines.
##### Patterned Fields
Field Pattern | Type | Description
---|:---:|---
-[HTTP Status Code](#httpCodes) | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | Any [HTTP status code](#httpCodes) can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. A [Reference Object](#referenceObject) can link to a response that is defined in the [OpenAPI Object's components/responses](#componentsResponses) section. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. The following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response range is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
+[HTTP Status Code](#http-status-codes) | [Response Object](#response-object) \| [Reference Object](#reference-object) | Any [HTTP status code](#http-status-codes) can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. A [Reference Object](#reference-object) can link to a response that is defined in the [OpenAPI Object's components/responses](#componentsResponses) section. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. The following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response range is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Responses Object Example
@@ -1663,7 +1663,7 @@ A 200 response for a successful operation and a default response for others (imp
```yaml
'200':
description: a pet to be returned
- content:
+ content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
@@ -1675,19 +1675,19 @@ default:
$ref: '#/components/schemas/ErrorModel'
```
-#### Response Object
-Describes a single response from an API Operation, including design-time, static
+#### Response Object
+Describes a single response from an API Operation, including design-time, static
`links` to operations based on the response.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
description | `string` | **REQUIRED**. A short description of the response. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-headers | Map[`string`, [Header Object](#headerObject) \| [Reference Object](#referenceObject)] | Maps a header name to its definition. [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
-content | Map[`string`, [Media Type Object](#mediaTypeObject)] | A map containing descriptions of potential response payloads. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
-links | Map[`string`, [Link Object](#linkObject) \| [Reference Object](#referenceObject)] | A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for [Component Objects](#componentsObject).
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | Maps a header name to its definition. [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing descriptions of potential response payloads. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for [Component Objects](#components-object).
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Response Object Examples
@@ -1711,9 +1711,9 @@ Response of an array of a complex type:
```yaml
description: A complex object array response
-content:
+content:
application/json:
- schema:
+ schema:
type: array
items:
$ref: '#/components/schemas/VeryComplexType'
@@ -1812,25 +1812,25 @@ Response with no return value:
description: object created
```
-#### Callback Object
+#### Callback Object
A map of possible out-of band callbacks related to the parent operation.
-Each value in the map is a [Path Item Object](#pathItemObject) that describes a set of requests that may be initiated by the API provider and the expected responses.
+Each value in the map is a [Path Item Object](#path-item-object) that describes a set of requests that may be initiated by the API provider and the expected responses.
The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
##### Patterned Fields
Field Pattern | Type | Description
---|:---:|---
-{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
+{expression} | [Path Item Object](#path-item-object) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Key Expression
-The key that identifies the [Path Item Object](#pathItemObject) is a [runtime expression](#runtimeExpression) that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.
+The key that identifies the [Path Item Object](#path-item-object) is a [runtime expression](#runtime-expressions) that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.
A simple example might be `$request.body#/url`.
-However, using a [runtime expression](#runtimeExpression) the complete HTTP message can be accessed.
-This includes accessing any part of a body that a JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) can reference.
+However, using a [runtime expression](#runtime-expressions) the complete HTTP message can be accessed.
+This includes accessing any part of a body that a JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) can reference.
For example, given the following HTTP request:
@@ -1846,7 +1846,7 @@ Content-Length: 187
"http://clientdomain.com/fast",
"http://clientdomain.com/medium",
"http://clientdomain.com/slow"
- ]
+ ]
}
201 Created
@@ -1855,7 +1855,7 @@ Location: http://example.org/subscription/1
The following examples show how the various expressions evaluate, assuming the callback operation has a path parameter named `eventType` and a query parameter named `queryUrl`.
-Expression | Value
+Expression | Value
---|:---
$url | http://example.org/subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning
$method | POST
@@ -1877,7 +1877,7 @@ myWebhook:
post:
requestBody:
description: Callback payload
- content:
+ content:
'application/json':
schema:
$ref: '#/components/schemas/SomePayload'
@@ -1887,7 +1887,7 @@ myWebhook:
```
-#### Example Object
+#### Example Object
##### Fixed Fields
Field Name | Type | Description
@@ -1895,12 +1895,12 @@ Field Name | Type | Description
summary | `string` | Short description for the example.
description | `string` | Long description for the example. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
value | Any | Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
-externalValue | `string` | A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `externalValue` field are mutually exclusive.
+externalValue | `string` | A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `externalValue` field are mutually exclusive.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
-In all cases, the example value is expected to be compatible with the type schema
-of its associated value. Tooling implementations MAY choose to
+In all cases, the example value is expected to be compatible with the type schema
+of its associated value. Tooling implementations MAY choose to
validate compatibility automatically, and reject the example value(s) if incompatible.
##### Example Object Example
@@ -1921,7 +1921,7 @@ schemas:
'application/json':
schema:
$ref: '#/components/schemas/Address'
- examples:
+ examples:
foo:
summary: A foo example
value: {"foo": "bar"}
@@ -1929,15 +1929,15 @@ schemas:
summary: A bar example
value: {"bar": "baz"}
'application/xml':
- examples:
+ examples:
xmlExample:
summary: This is an example in XML
externalValue: 'http://example.org/examples/address-example.xml'
'text/plain':
examples:
- textExample:
+ textExample:
summary: This is a text example
- externalValue: 'http://foo.bar/examples/address-example.txt'
+ externalValue: 'http://foo.bar/examples/address-example.txt'
# in a parameter
@@ -1948,14 +1948,14 @@ schemas:
type: 'string'
format: 'zip-code'
examples:
- zip-example:
+ zip-example:
$ref: '#/components/examples/zip-example'
# in a response
responses:
'200':
description: your car appointment has been booked
- content:
+ content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
@@ -1965,31 +1965,31 @@ schemas:
```
-#### Link Object
+#### Link Object
The `Link object` represents a possible design-time link for a response.
The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response.
-For computing links, and providing instructions to execute them, a [runtime expression](#runtimeExpression) is used for accessing values in an operation and using them as parameters while invoking the linked operation.
+For computing links, and providing instructions to execute them, a [runtime expression](#runtime-expressions) is used for accessing values in an operation and using them as parameters while invoking the linked operation.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
-operationRef | `string` | A relative or absolute reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an [Operation Object](#operationObject). Relative `operationRef` values MAY be used to locate an existing [Operation Object](#operationObject) in the OpenAPI definition.
-operationId | `string` | The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
-parameters | Map[`string`, Any \| [{expression}](#runtimeExpression)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path.id).
-requestBody | Any \| [{expression}](#runtimeExpression) | A literal value or [{expression}](#runtimeExpression) to use as a request body when calling the target operation.
+operationRef | `string` | A relative or absolute reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an [Operation Object](#operation-object). Relative `operationRef` values MAY be used to locate an existing [Operation Object](#operation-object) in the OpenAPI definition.
+operationId | `string` | The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
+parameters | Map[`string`, Any \| [{expression}](#runtime-expressions)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path.id).
+requestBody | Any \| [{expression}](#runtime-expressions) | A literal value or [{expression}](#runtime-expressions) to use as a request body when calling the target operation.
description | `string` | A description of the link. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-server | [Server Object](#serverObject) | A server object to be used by the target operation.
+server | [Server Object](#server-object) | A server object to be used by the target operation.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
A linked operation MUST be identified using either an `operationRef` or `operationId`.
In the case of an `operationId`, it MUST be unique and resolved in the scope of the OAS document.
-Because of the potential for name clashes, the `operationRef` syntax is preferred
+Because of the potential for name clashes, the `operationRef` syntax is preferred
for specifications with external references.
##### Examples
@@ -2003,7 +2003,7 @@ paths:
- name: id
in: path
required: true
- description: the user identifier, as userId
+ description: the user identifier, as userId
schema:
type: string
get:
@@ -2031,7 +2031,7 @@ paths:
- name: userid
in: path
required: true
- description: the user identifier, as userId
+ description: the user identifier, as userId
schema:
type: string
# linked operation
@@ -2055,14 +2055,14 @@ links:
userUuid: $response.body#/uuid
```
-Clients follow all links at their discretion.
-Neither permissions, nor the capability to make a successful call to that link, is guaranteed
+Clients follow all links at their discretion.
+Neither permissions, nor the capability to make a successful call to that link, is guaranteed
solely by the existence of a relationship.
##### OperationRef Examples
-As references to `operationId` MAY NOT be possible (the `operationId` is an optional
+As references to `operationId` MAY NOT be possible (the `operationId` is an optional
value), references MAY also be made through a relative `operationRef`:
```yaml
@@ -2085,52 +2085,52 @@ links:
username: $response.body#/username
```
-Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
+Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
using JSON references.
-##### Runtime Expressions
+##### Runtime Expressions
Runtime expressions allow defining values based on information that will only be available within the HTTP message in an actual API call.
-This mechanism is used by [Link Objects](#linkObject) and [Callback Objects](#callbackObject).
+This mechanism is used by [Link Objects](#link-object) and [Callback Objects](#callback-object).
The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
```
expression = ( "$url" | "$method" | "$statusCode" | "$request." source | "$response." source )
- source = ( header-reference | query-reference | path-reference | body-reference )
+ source = ( header-reference | query-reference | path-reference | body-reference )
header-reference = "header." token
- query-reference = "query." name
+ query-reference = "query." name
path-reference = "path." name
body-reference = "body" ["#" fragment]
- fragment = a JSON Pointer [RFC 6901](https://tools.ietf.org/html/rfc6901)
+ fragment = a JSON Pointer [RFC 6901](https://tools.ietf.org/html/rfc6901)
name = *( char )
char = as per RFC [7159](https://tools.ietf.org/html/rfc7159#section-7)
token = as per RFC [7230](https://tools.ietf.org/html/rfc7230#section-3.2.6)
```
-The `name` identifier is case-sensitive, whereas `token` is not.
+The `name` identifier is case-sensitive, whereas `token` is not.
The table below provides examples of runtime expressions and examples of their use in a value:
-##### Examples
+##### Examples
Source Location | example expression | notes
---|:---|:---|
HTTP Method | `$method` | The allowable values for the `$method` will be those for the HTTP operation.
-Requested media type | `$request.header.accept` |
+Requested media type | `$request.header.accept` |
Request parameter | `$request.path.id` | Request parameters MUST be declared in the `parameters` section of the parent operation or they cannot be evaluated. This includes request headers.
Request body property | `$request.body#/user/uuid` | In operations which accept payloads, references may be made to portions of the `requestBody` or the entire body.
-Request URL | `$url` |
+Request URL | `$url` |
Response value | `$response.body#/status` | In operations which return payloads, references may be made to portions of the response body or the entire body.
Response header | `$response.header.Server` | Single header values only are available
Runtime expressions preserve the type of the referenced value.
Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
-#### Header Object
+#### Header Object
-The Header Object follows the structure of the [Parameter Object](#parameterObject) with the following changes:
+The Header Object follows the structure of the [Parameter Object](#parameter-object) with the following changes:
1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
1. `in` MUST NOT be specified, it is implicitly in `header`.
@@ -2155,9 +2155,9 @@ schema:
type: integer
```
-#### Tag Object
+#### Tag Object
-Adds metadata to a single tag that is used by the [Operation Object](#operationObject).
+Adds metadata to a single tag that is used by the [Operation Object](#operation-object).
It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
##### Fixed Fields
@@ -2165,9 +2165,9 @@ Field Name | Type | Description
---|:---:|---
name | `string` | **REQUIRED**. The name of the tag.
description | `string` | A short description for the tag. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
-externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this tag.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this tag.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Tag Object Example
@@ -2183,16 +2183,16 @@ name: pet
description: Pets operations
```
-#### Examples Object
+#### Examples Object
-In an `example`, a JSON Reference MAY be used, with the
-explicit restriction that examples having a JSON format with object named
-`$ref` are not allowed. Therefore, that `example`, structurally, can be
+In an `example`, a JSON Reference MAY be used, with the
+explicit restriction that examples having a JSON format with object named
+`$ref` are not allowed. Therefore, that `example`, structurally, can be
either a string primitive or an object, similar to `additionalProperties`.
-In all cases, the payload is expected to be compatible with the type schema
-for the associated value. Tooling implementations MAY choose to
-validate compatibility automatically, and reject the example value(s) if they
+In all cases, the payload is expected to be compatible with the type schema
+for the associated value. Tooling implementations MAY choose to
+validate compatibility automatically, and reject the example value(s) if they
are incompatible.
```yaml
@@ -2223,7 +2223,7 @@ schemas:
examples:
text:
externalValue: 'http://foo.bar/examples/address-example.txt'
-
+
# in a parameter
parameters:
- name: 'zipCode'
@@ -2231,14 +2231,14 @@ schemas:
schema:
type: 'string'
format: 'zip-code'
- example:
+ example:
$ref: 'http://foo.bar#/examples/zip-example'
# in a response, note the singular `example`:
responses:
'200':
description: your car appointment has been booked
- content:
+ content:
application/json:
schema:
$ref: '#/components/schemas/SuccessResponse'
@@ -2246,11 +2246,11 @@ schemas:
$ref: http://foo.bar#/examples/address-example.json
```
-#### Reference Object
+#### Reference Object
A simple object to allow referencing other components in the specification, internally and externally.
-The Reference Object is defined by [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) and follows the same structure, behavior and rules.
+The Reference Object is defined by [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) and follows the same structure, behavior and rules.
For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification.
@@ -2295,7 +2295,7 @@ $ref: Pet.yaml
$ref: definitions.yaml#/Pet
```
-#### Schema Object
+#### Schema Object
The Schema Object allows the definition of input and output data types.
These types can be objects, but also primitives and arrays.
@@ -2304,7 +2304,7 @@ This object is an extended subset of the [JSON Schema Specification Wright Draft
For more information about the properties, see [JSON Schema Core](https://tools.ietf.org/html/draft-wright-json-schema-00) and [JSON Schema Validation](https://tools.ietf.org/html/draft-wright-json-schema-validation-00).
Unless stated otherwise, the property definitions follow the JSON Schema.
-##### Properties
+##### Properties
The following properties are taken directly from the JSON Schema definition and follow the same specifications:
@@ -2325,20 +2325,20 @@ The following properties are taken directly from the JSON Schema definition and
- required
- enum
-The following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
+The following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
- type - Value MUST be a string. Multiple types via an array are not supported.
-- allOf - Inline or referenced schema MUST be of a [Schema Object](#schemaObject) and not a standard JSON Schema.
-- oneOf - Inline or referenced schema MUST be of a [Schema Object](#schemaObject) and not a standard JSON Schema.
-- anyOf - Inline or referenced schema MUST be of a [Schema Object](#schemaObject) and not a standard JSON Schema.
-- not - Inline or referenced schema MUST be of a [Schema Object](#schemaObject) and not a standard JSON Schema.
-- items - Value MUST be an object and not an array. Inline or referenced schema MUST be of a [Schema Object](#schemaObject) and not a standard JSON Schema. `items` MUST be present if the `type` is `array`.
-- properties - Property definitions MUST be a [Schema Object](#schemaObject) and not a standard JSON Schema (inline or referenced).
-- additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a [Schema Object](#schemaObject) and not a standard JSON Schema.
+- allOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- oneOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- anyOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- not - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- items - Value MUST be an object and not an array. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema. `items` MUST be present if the `type` is `array`.
+- properties - Property definitions MUST be a [Schema Object](#schema-object) and not a standard JSON Schema (inline or referenced).
+- additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
- description - [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
- format - See [Data Type Formats](#dataTypeFormat) for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
- default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if `type` is `string`, then `default` can be `"foo"` but cannot be `1`.
-Alternatively, any time a Schema Object can be used, a [Reference Object](#referenceObject) can be used in its place. This allows referencing definitions instead of defining them inline.
+Alternatively, any time a Schema Object can be used, a [Reference Object](#reference-object) can be used in its place. This allows referencing definitions instead of defining them inline.
Additional properties defined by the JSON Schema specification that are not mentioned here are strictly unsupported.
@@ -2348,20 +2348,20 @@ Other than the JSON Schema subset fields, the following fields MAY be used for f
Field Name | Type | Description
---|:---:|---
nullable | `boolean` | Allows sending a `null` value for the defined schema. Default value is `false`.
-discriminator | [Discriminator Object](#discriminatorObject) | Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](#schemaComposition) for more details.
+discriminator | [Discriminator Object](#discriminator-object) | Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](#composition-and-inheritance-polymorphism) for more details.
readOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as `readOnly` being `true` and is in the `required` list, the `required` will take effect on the response only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
writeOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "write only". Therefore, it MAY be sent as part of a request but SHOULD NOT be sent as part of the response. If the property is marked as `writeOnly` being `true` and is in the `required` list, the `required` will take effect on the request only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
-xml | [XML Object](#xmlObject) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
-externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
+xml | [XML Object](#xml-object) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this schema.
example | Any | A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
-###### Composition and Inheritance (Polymorphism)
+###### Composition and Inheritance (Polymorphism)
The OpenAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition.
-`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
+`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
While composition offers model extensibility, it does not imply a hierarchy between the models.
To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
@@ -2375,7 +2375,7 @@ As such, inline schema definitions, which do not have a given id, *cannot* be us
###### XML Modeling
The [xml](#schemaXml) property allows extra definitions when translating the JSON definition to XML.
-The [XML Object](#xmlObject) contains additional information about the available options.
+The [XML Object](#xml-object) contains additional information about the available options.
##### Schema Object Examples
@@ -2705,7 +2705,7 @@ components:
- packSize
```
-#### Discriminator Object
+#### Discriminator Object
When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
@@ -2838,7 +2838,7 @@ will indicate that the `Cat` schema be used. Likewise this schema:
will map to `Dog` because of the definition in the `mappings` element.
-#### XML Object
+#### XML Object
A metadata object that allows for more fine-tuned XML model definitions.
@@ -2854,11 +2854,11 @@ Field Name | Type | Description
attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
wrapped | `boolean` | MAY be used only for an array definition. Signifies whether the array is wrapped (for example, ``) or unwrapped (``). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`).
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### XML Object Examples
-The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schemaObject) with a sample of the XML representation of it.
+The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schema-object) with a sample of the XML representation of it.
###### No XML Element
@@ -3191,7 +3191,7 @@ animals:
```
-#### Security Scheme Object
+#### Security Scheme Object
Defines a security scheme that can be used by the operations.
Supported schemes are HTTP authentication, an API key (either as a header or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in [RFC6749](https://tools.ietf.org/html/rfc6749), and [OpenID Connect Discovery](https://tools.ietf.org/html/draft-ietf-oauth-discovery-06).
@@ -3205,10 +3205,10 @@ Field Name | Type | Applies To | Description
in | `string` | `apiKey` | **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"` or `"cookie"`.
scheme | `string` | `http` | **REQUIRED**. The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-5.1).
bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
-flows | [OAuth Flows Object](#oauthFlowsObject) | `oauth2` | **REQUIRED**. An object containing configuration information for the flow types supported.
+flows | [OAuth Flows Object](#oauth-flows-object) | `oauth2` | **REQUIRED**. An object containing configuration information for the flow types supported.
openIdConnectUrl | `string` | `openIdConnect` | **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### Security Scheme Object Example
@@ -3277,7 +3277,7 @@ bearerFormat: JWT
```yaml
type: oauth2
-flows:
+flows:
implicit:
authorizationUrl: https://example.com/api/oauth/dialog
scopes:
@@ -3285,21 +3285,21 @@ flows:
read:pets: read your pets
```
-#### OAuth Flows Object
+#### OAuth Flows Object
Allows configuration of the supported OAuth Flows.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
-implicit| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Implicit flow
-password| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Resource Owner Password flow
-clientCredentials| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
-authorizationCode| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
+implicit| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Implicit flow
+password| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Resource Owner Password flow
+clientCredentials| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
+authorizationCode| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
-#### OAuth Flow Object
+#### OAuth Flow Object
Configuration details for a supported OAuth Flow
@@ -3311,7 +3311,7 @@ Field Name | Type | Applies To | Description
refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
scopes | Map[`string`, `string`] | `oauth2` | **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
-This object MAY be extended with [Specification Extensions](#specificationExtensions).
+This object MAY be extended with [Specification Extensions](#specification-extensions).
##### OAuth Flow Object Examples
@@ -3340,7 +3340,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
```YAML
type: oauth2
-flows:
+flows:
implicit:
authorizationUrl: https://example.com/api/oauth/dialog
scopes:
@@ -3351,25 +3351,25 @@ flows:
tokenUrl: https://example.com/api/oauth/token
scopes:
write:pets: modify pets in your account
- read:pets: read your pets
+ read:pets: read your pets
```
-#### Security Requirement Object
+#### Security Requirement Object
Lists the required security schemes to execute this operation.
-The name used for each property MUST correspond to a security scheme declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#componentsObject).
+The name used for each property MUST correspond to a security scheme declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object).
Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized.
This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
-When a list of Security Requirement Objects is defined on the [Open API object](#oasObject) or [Operation Object](#operationObject), only one of Security Requirement Objects in the list needs to be satisfied to authorize the request.
+When a list of Security Requirement Objects is defined on the [Open API object](#openapi-object) or [Operation Object](#operation-object), only one of Security Requirement Objects in the list needs to be satisfied to authorize the request.
##### Patterned Fields
Field Pattern | Type | Description
---|:---:|---
-{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#componentsObject). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.
+{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.
##### Security Requirement Object Examples
@@ -3402,7 +3402,7 @@ petstore_auth:
- read:pets
```
-### Specification Extensions
+### Specification Extensions
While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
@@ -3414,19 +3414,19 @@ Field Pattern | Type | Description
The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).
-### Security Filtering
+### Security Filtering
-Some objects in the OpenAPI Specification MAY be declared and remain empty, or be completely removed, even though they are inherently the core of the API documentation.
+Some objects in the OpenAPI Specification MAY be declared and remain empty, or be completely removed, even though they are inherently the core of the API documentation.
The reasoning is to allow an additional layer of access control over the documentation.
While not part of the specification itself, certain libraries MAY choose to allow access to parts of the documentation based on some form of authentication/authorization.
Two examples of this:
-1. The [Paths Object](#pathsObject) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#infoObject) which may contain additional information regarding authentication.
-2. The [Path Item Object](#pathItemObject) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different than hiding the path itself from the [Paths Object](#pathsObject), so the user will not be aware of its existence. This allows the documentation provider to finely control what the viewer can see.
+1. The [Paths Object](#paths-object) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#info-object) which may contain additional information regarding authentication.
+2. The [Path Item Object](#path-item-object) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different than hiding the path itself from the [Paths Object](#paths-object), so the user will not be aware of its existence. This allows the documentation provider to finely control what the viewer can see.
-## Appendix A: Revision History
+## Appendix A: Revision History
Version | Date | Notes
--- | --- | ---
diff --git a/versions/3.0.1.md b/versions/3.0.1.md
new file mode 100644
index 0000000000..2c1ba6c317
--- /dev/null
+++ b/versions/3.0.1.md
@@ -0,0 +1,3380 @@
+# OpenAPI Specification
+
+#### Version 3.0.1
+
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
+
+This document is licensed under [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).
+
+## Introduction
+
+The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.
+
+An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
+
+## Table of Contents
+
+
+- [Definitions](#definitions)
+ - [OpenAPI Document](#openapi-document)
+ - [Path Templating](#path-templating)
+ - [Media Types](#media-types)
+ - [HTTP Status Codes](#http-status-codes)
+- [Specification](#specification)
+ - [Versions](#versions)
+ - [Format](#format)
+ - [Document Structure](#document-structure)
+ - [Data Types](#data-types)
+ - [Rich Text Formatting](#rich-text-formatting)
+ - [Relative References In URLs](#relative-references-in-urls)
+ - [Schema](#schema)
+ - [OpenAPI Object](#openapi-object)
+ - [Info Object](#info-object)
+ - [Contact Object](#contact-object)
+ - [License Object](#license-object)
+ - [Server Object](#server-object)
+ - [Server Variable Object](#server-variable-object)
+ - [Components Object](#components-object)
+ - [Paths Object](#paths-object)
+ - [Path Item Object](#path-item-object)
+ - [Operation Object](#operation-object)
+ - [External Documentation Object](#external-documentation-object)
+ - [Parameter Object](#parameter-object)
+ - [Request Body Object](#request-body-object)
+ - [Media Type Object](#media-type-object)
+ - [Encoding Object](#encoding-object)
+ - [Responses Object](#responses-object)
+ - [Response Object](#response-object)
+ - [Callback Object](#callback-object)
+ - [Example Object](#example-object)
+ - [Link Object](#link-object)
+ - [Header Object](#header-object)
+ - [Tag Object](#tag-object)
+ - [Reference Object](#reference-object)
+ - [Schema Object](#schema-object)
+ - [Discriminator Object](#discriminator-object)
+ - [XML Object](#xml-object)
+ - [Security Scheme Object](#security-scheme-object)
+ - [OAuth Flows Object](#oauth-flows-object)
+ - [OAuth Flow Object](#oauth-flow-object)
+ - [Security Requirement Object](#security-requirement-object)
+ - [Specification Extensions](#specification-extensions)
+ - [Security Filtering](#security-filtering)
+- [Appendix A: Revision History](#appendix-a-revision-history)
+
+
+
+
+## Definitions
+
+##### OpenAPI Document
+A document (or set of documents) that defines or describes an API. An OpenAPI definition uses and conforms to the OpenAPI Specification.
+
+##### Path Templating
+Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.
+
+##### Media Types
+Media type definitions are spread across several resources.
+The media type definitions SHOULD be in compliance with [RFC6838](https://tools.ietf.org/html/rfc6838).
+
+Some examples of possible media type definitions:
+```
+ text/plain; charset=utf-8
+ application/json
+ application/vnd.github+json
+ application/vnd.github.v3+json
+ application/vnd.github.v3.raw+json
+ application/vnd.github.v3.text+json
+ application/vnd.github.v3.html+json
+ application/vnd.github.v3.full+json
+ application/vnd.github.v3.diff
+ application/vnd.github.v3.patch
+```
+##### HTTP Status Codes
+The HTTP Status Codes are used to indicate the status of the executed operation.
+The available status codes are defined by [RFC7231](https://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
+
+## Specification
+
+### Versions
+
+The OpenAPI Specification is versioned using [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) (semver) and follows the semver specification.
+
+The `major`.`minor` portion of the semver (for example `3.0`) SHALL designate the OAS feature set. Typically, *`.patch`* versions address errors in this document, not the feature set. Tooling which supports OAS 3.0 SHOULD be compatible with all OAS 3.0.\* versions. The patch version SHOULD NOT be considered by tooling, making no distinction between `3.0.0` and `3.0.1` for example.
+
+Subsequent minor version releases of the OpenAPI Specification (incrementing the `minor` version number) SHOULD NOT interfere with tooling developed to a lower minor version and same major version. Thus a hypothetical `3.1.0` specification SHOULD be usable with tooling designed for `3.0.0`.
+
+An OpenAPI document compatible with OAS 3.\*.\* contains a required [`openapi`](#oasVersion) field which designates the semantic version of the OAS that it uses. (OAS 2.0 documents contain a top-level version field named [`swagger`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swaggerObject) and value `"2.0"`.)
+
+### Format
+
+An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
+
+For example, if a field has an array value, the JSON array representation will be used:
+
+```json
+{
+ "field": [ 1, 2, 3 ]
+}
+```
+All field names in the specification are **case sensitive**.
+
+The schema exposes two types of fields: Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name.
+
+Patterned fields MUST have unique names within the containing object.
+
+In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](http://www.yaml.org/spec/1.2/spec.html) is RECOMMENDED along with some additional constraints:
+
+- Tags MUST be limited to those allowed by the [JSON Schema ruleset](http://www.yaml.org/spec/1.2/spec.html#id2803231).
+- Keys used in YAML maps MUST be limited to a scalar string, as defined by the [YAML Failsafe schema ruleset](http://yaml.org/spec/1.2/spec.html#id2802346).
+
+**Note:** While APIs may be defined by OpenAPI documents in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
+
+### Document Structure
+
+An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the user. In the latter case, `$ref` fields MUST be used in the specification to reference those parts as follows from the [JSON Schema](http://json-schema.org) definitions.
+
+It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `openapi.yaml`.
+
+### Data Types
+
+Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
+Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
+`null` is not supported as a type (see [`nullable`](#schemaNullable) for an alternative solution).
+Models are defined using the [Schema Object](#schema-object), which is an extended subset of JSON Schema Specification Wright Draft 00.
+
+Primitives have an optional modifier property: `format`.
+OAS uses several known formats to define in fine detail the data type being used.
+However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value.
+Formats such as `"email"`, `"uuid"`, and so on, MAY be used even though undefined by this specification.
+Types that are not accompanied by a `format` property follow the type definition in the JSON Schema. Tools that do not recognize a specific `format` MAY default back to the `type` alone, as if the `format` is not specified.
+
+The formats defined by the OAS are:
+
+Common Name | [`type`](#data-types) | [`format`](#dataTypeFormat) | Comments
+----------- | ------ | -------- | --------
+integer | `integer` | `int32` | signed 32 bits
+long | `integer` | `int64` | signed 64 bits
+float | `number` | `float` | |
+double | `number` | `double` | |
+string | `string` | | |
+byte | `string` | `byte` | base64 encoded characters
+binary | `string` | `binary` | any sequence of octets
+boolean | `boolean` | | |
+date | `string` | `date` | As defined by `full-date` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
+dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
+password | `string` | `password` | A hint to UIs to obscure input.
+
+### Rich Text Formatting
+Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
+Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](http://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
+
+### Relative References in URLs
+
+Unless specified otherwise, all properties that are URLs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+Relative references are resolved using the URLs defined in the [`Server Object`](#server-object) as a Base URI.
+
+Relative references used in `$ref` are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), using the URL of the current document as the base URI. See also the [Reference Object](#reference-object).
+
+### Schema
+
+In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
+
+#### OpenAPI Object
+
+This is the root document object of the [OpenAPI document](#openapi-document).
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+openapi | `string` | **REQUIRED**. This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenAPI Specification version](#versions) that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is *not* related to the API [`info.version`](#infoVersion) string.
+info | [Info Object](#info-object) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
+servers | [[Server Object](#server-object)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#serverUrl) value of `/`.
+paths | [Paths Object](#paths-object) | **REQUIRED**. The available paths and operations for the API.
+components | [Components Object](#components-object) | An element to hold various schemas for the specification.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
+tags | [[Tag Object](#tag-object)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operation-object) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Info Object
+
+The object provides metadata about the API.
+The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+title | `string` | **REQUIRED**. The title of the application.
+description | `string` | A short description of the application. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
+contact | [Contact Object](#contact-object) | The contact information for the exposed API.
+license | [License Object](#license-object) | The license information for the exposed API.
+version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Info Object Example:
+
+```json
+{
+ "title": "Sample Pet Store App",
+ "description": "This is a sample server for a pet store.",
+ "termsOfService": "http://example.com/terms/",
+ "contact": {
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+ },
+ "version": "1.0.1"
+}
+```
+
+```yaml
+title: Sample Pet Store App
+description: This is a sample server for a pet store.
+termsOfService: http://example.com/terms/
+contact:
+ name: API Support
+ url: http://www.example.com/support
+ email: support@example.com
+license:
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+version: 1.0.1
+```
+
+#### Contact Object
+
+Contact information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | The identifying name of the contact person/organization.
+url | `string` | The URL pointing to the contact information. MUST be in the format of a URL.
+email | `string` | The email address of the contact person/organization. MUST be in the format of an email address.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Contact Object Example:
+
+```json
+{
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+}
+```
+
+```yaml
+name: API Support
+url: http://www.example.com/support
+email: support@example.com
+```
+
+#### License Object
+
+License information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The license name used for the API.
+url | `string` | A URL to the license used for the API. MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### License Object Example:
+
+```json
+{
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+}
+```
+
+```yaml
+name: Apache 2.0
+url: https://www.apache.org/licenses/LICENSE-2.0.html
+```
+
+#### Server Object
+
+An object representing a Server.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
+description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+variables | Map[`string`, [Server Variable Object](#server-variable-object)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Server Object Example
+
+A single server would be described as:
+
+```json
+{
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+}
+```
+
+```yaml
+url: https://development.gigantic-server.com/v1
+description: Development server
+```
+
+The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+ },
+ {
+ "url": "https://staging.gigantic-server.com/v1",
+ "description": "Staging server"
+ },
+ {
+ "url": "https://api.gigantic-server.com/v1",
+ "description": "Production server"
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://development.gigantic-server.com/v1
+ description: Development server
+- url: https://staging.gigantic-server.com/v1
+ description: Staging server
+- url: https://api.gigantic-server.com/v1
+ description: Production server
+```
+
+The following shows how variables can be used for a server configuration:
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
+ "description": "The production API server",
+ "variables": {
+ "username": {
+ "default": "demo",
+ "description": "this value is assigned by the service provider, in this example `gigantic-server.com`"
+ },
+ "port": {
+ "enum": [
+ "8443",
+ "443"
+ ],
+ "default": "8443"
+ },
+ "basePath": {
+ "default": "v2"
+ }
+ }
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://{username}.gigantic-server.com:{port}/{basePath}
+ description: The production API server
+ variables:
+ username:
+ # note! no enum here means it is an open value
+ default: demo
+ description: this value is assigned by the service provider, in this example `gigantic-server.com`
+ port:
+ enum:
+ - '8443'
+ - '443'
+ default: '8443'
+ basePath:
+ # open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
+ default: v2
+```
+
+
+#### Server Variable Object
+
+An object representing a Server Variable for server URL template substitution.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+enum | [`string`] | An enumeration of string values to be used if the substitution options are from a limited set.
+default | `string` | **REQUIRED**. The default value to use for substitution, and to send, if an alternate value is _not_ supplied. Unlike the [Schema Object's](#schema-object) `default`, this value MUST be provided by the consumer.
+description | `string` | An optional description for the server variable. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Components Object
+
+Holds a set of reusable objects for different aspects of the OAS.
+All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
+
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---|---
+ schemas | Map[`string`, [Schema Object](#schema-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Schema Objects](#schema-object).
+ responses | Map[`string`, [Response Object](#response-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Response Objects](#response-object).
+ parameters | Map[`string`, [Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Parameter Objects](#parameter-object).
+ examples | Map[`string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Example Objects](#example-object).
+ requestBodies | Map[`string`, [Request Body Object](#request-body-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Request Body Objects](#request-body-object).
+ headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Header Objects](#header-object).
+ securitySchemes| Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object).
+ links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Link Objects](#link-object).
+ callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Callback Objects](#callback-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`.
+
+Field Name Examples:
+
+```
+User
+User_1
+User_Name
+user-name
+my.org.User
+```
+
+##### Components Object Example
+
+```json
+"components": {
+ "schemas": {
+ "Category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "Tag": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "skipParam": {
+ "name": "skip",
+ "in": "query",
+ "description": "number of items to skip",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "limitParam": {
+ "name": "limit",
+ "in": "query",
+ "description": "max records to return",
+ "required": true,
+ "schema" : {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ },
+ "responses": {
+ "NotFound": {
+ "description": "Entity not found."
+ },
+ "IllegalInput": {
+ "description": "Illegal input for operation."
+ },
+ "GeneralError": {
+ "description": "General Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GeneralError"
+ }
+ }
+ }
+ }
+ },
+ "securitySchemes": {
+ "api_key": {
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+ },
+ "petstore_auth": {
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "http://example.org/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ Category:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ parameters:
+ skipParam:
+ name: skip
+ in: query
+ description: number of items to skip
+ required: true
+ schema:
+ type: integer
+ format: int32
+ limitParam:
+ name: limit
+ in: query
+ description: max records to return
+ required: true
+ schema:
+ type: integer
+ format: int32
+ responses:
+ NotFound:
+ description: Entity not found.
+ IllegalInput:
+ description: Illegal input for operation.
+ GeneralError:
+ description: General Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GeneralError'
+ securitySchemes:
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: http://example.org/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+
+#### Paths Object
+
+Holds the relative paths to the individual endpoints and their operations.
+The path is appended to the URL from the [`Server Object`](#server-object) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#security-filtering).
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+/{path} | [Path Item Object](#path-item-object) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#server-object)'s `url` field in order to construct the full URL. [Path templating](#path-templating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Templating Matching
+
+Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
+
+```
+ /pets/{petId}
+ /pets/mine
+```
+
+The following paths are considered identical and invalid:
+
+```
+ /pets/{petId}
+ /pets/{name}
+```
+
+The following may lead to ambiguous resolution:
+
+```
+ /{entity}/me
+ /books/{id}
+```
+
+##### Paths Object Example
+
+```json
+{
+ "/pets": {
+ "get": {
+ "description": "Returns all pets from the system that the user has access to",
+ "responses": {
+ "200": {
+ "description": "A list of pets.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/pet"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+/pets:
+ get:
+ description: Returns all pets from the system that the user has access to
+ responses:
+ '200':
+ description: A list of pets.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/pet'
+```
+
+#### Path Item Object
+
+Describes the operations available on a single path.
+A Path Item MAY be empty, due to [ACL constraints](#security-filtering).
+The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#path-item-object). If there are conflicts between the referenced definition and this Path Item's definition, the behavior is *undefined*.
+summary| `string` | An optional, string summary, intended to apply to all operations in this path.
+description | `string` | An optional, string description, intended to apply to all operations in this path. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+get | [Operation Object](#operation-object) | A definition of a GET operation on this path.
+put | [Operation Object](#operation-object) | A definition of a PUT operation on this path.
+post | [Operation Object](#operation-object) | A definition of a POST operation on this path.
+delete | [Operation Object](#operation-object) | A definition of a DELETE operation on this path.
+options | [Operation Object](#operation-object) | A definition of a OPTIONS operation on this path.
+head | [Operation Object](#operation-object) | A definition of a HEAD operation on this path.
+patch | [Operation Object](#operation-object) | A definition of a PATCH operation on this path.
+trace | [Operation Object](#operation-object) | A definition of a TRACE operation on this path.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service all operations in this path.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Item Object Example
+
+```json
+{
+ "get": {
+ "description": "Returns pets based on ID",
+ "summary": "Find pets by ID",
+ "operationId": "getPetsById",
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "error payload",
+ "content": {
+ "text/html": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "ID of pet to use",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "simple"
+ }
+ ]
+}
+```
+
+```yaml
+get:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: getPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*' :
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ 'text/html':
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+parameters:
+- name: id
+ in: path
+ description: ID of pet to use
+ required: true
+ schema:
+ type: array
+ style: simple
+ items:
+ type: string
+```
+
+#### Operation Object
+
+Describes a single API operation on a path.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
+summary | `string` | A short summary of what the operation does.
+description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this operation.
+operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+requestBody | [Request Body Object](#request-body-object) \| [Reference Object](#reference-object) | The request body applicable for this operation. The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, `requestBody` SHALL be ignored by consumers.
+responses | [Responses Object](#responses-object) | **REQUIRED**. The list of possible responses as they are returned from executing this operation.
+callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callback-object) that describes a request that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Operation Object Example
+
+```json
+{
+ "tags": [
+ "pet"
+ ],
+ "summary": "Updates a pet in the store with form data",
+ "operationId": "updatePetWithForm",
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/x-www-form-urlencoded": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Updated name of the pet",
+ "type": "string"
+ },
+ "status": {
+ "description": "Updated status of the pet",
+ "type": "string"
+ }
+ },
+ "required": ["status"]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Pet updated.",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ },
+ "405": {
+ "description": "Invalid input",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+}
+```
+
+```yaml
+tags:
+- pet
+summary: Updates a pet in the store with form data
+operationId: updatePetWithForm
+parameters:
+- name: petId
+ in: path
+ description: ID of pet that needs to be updated
+ required: true
+ schema:
+ type: string
+requestBody:
+ content:
+ 'application/x-www-form-urlencoded':
+ schema:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ required:
+ - status
+responses:
+ '200':
+ description: Pet updated.
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+ '405':
+ description: Invalid input
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+security:
+- petstore_auth:
+ - write:pets
+ - read:pets
+```
+
+
+#### External Documentation Object
+
+Allows referencing an external resource for extended documentation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A short description of the target documentation. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+url | `string` | **REQUIRED**. The URL for the target documentation. Value MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### External Documentation Object Example
+
+```json
+{
+ "description": "Find more info here",
+ "url": "https://example.com"
+}
+```
+
+```yaml
+description: Find more info here
+url: https://example.com
+```
+
+#### Parameter Object
+
+Describes a single operation parameter.
+
+A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
+
+##### Parameter Locations
+There are four possible parameter locations specified by the `in` field:
+* path - Used together with [Path Templating](#path-templating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
+* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
+* header - Custom headers that are expected as part of the request. Note that [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive.
+* cookie - Used to pass a specific cookie value to the API.
+
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*.
If [`in`](#parameterIn) is `"path"`, the `name` field MUST correspond to the associated path segment from the [path](#pathsPath) field in the [Paths Object](#paths-object). See [Path Templating](#path-templating) for further information.
If [`in`](#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
For all other cases, the `name` corresponds to the parameter name used by the [`in`](#parameterIn) property.
+in | `string` | **REQUIRED**. The location of the parameter. Possible values are "query", "header", "path" or "cookie".
+description | `string` | A brief description of the parameter. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+required | `boolean` | Determines whether this parameter is mandatory. If the [parameter location](#parameterIn) is "path", this property is **REQUIRED** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
+ deprecated | `boolean` | Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.
+ allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows sending a parameter with an empty value. Default value is `false`. If [`style`](#parameterStyle) is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored.
+
+The rules for serialization of the parameter are specified in one of two ways.
+For simpler scenarios, a [`schema`](#parameterSchema) and [`style`](#parameterStyle) can describe the structure and syntax of the parameter.
+
+Field Name | Type | Description
+---|:---:|---
+style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
+explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When [`style`](#parameterStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the type used for the parameter.
+example | Any | Example of the media type. The example SHOULD match the specified schema and encoding properties if present. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+
+For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter.
+A parameter MUST contain either a `schema` property, or a `content` property, but not both.
+When `example` or `examples` are provided in conjunction with the `schema` object, the example MUST follow the prescribed serialization strategy for the parameter.
+
+
+Field Name | Type | Description
+---|:---:|---
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
+
+##### Style Values
+
+In order to support common ways of serializing simple parameters, a set of `style` values are defined.
+
+`style` | [`type`](#data-types) | `in` | Comments
+----------- | ------ | -------- | --------
+matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
+label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
+form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` with a `csv` (when `explode` is false) or `multi` (when `explode` is true) value from OpenAPI 2.0.
+simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2). This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0.
+spaceDelimited | `array` | `query` | Space separated array values. This option replaces `collectionFormat` equal to `ssv` from OpenAPI 2.0.
+pipeDelimited | `array` | `query` | Pipe separated array values. This option replaces `collectionFormat` equal to `pipes` from OpenAPI 2.0.
+deepObject | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
+
+
+##### Style Examples
+
+Assume a parameter named `color` has one of the following values:
+
+```
+ string -> "blue"
+ array -> ["blue","black","brown"]
+ object -> { "R": 100, "G": 200, "B": 150 }
+```
+The following table shows examples of rendering differences for each value.
+
+[`style`](#dataTypeFormat) | `explode` | `empty` | `string` | `array` | `object`
+----------- | ------ | -------- | -------- | --------|-------
+matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150
+matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150
+label | false | . | .blue | .blue.black.brown | .R.100.G.200.B.150
+label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150
+form | false | color= | color=blue | color=blue,black,brown | color=R,100,G,200,B,150
+form | true | color= | color=blue | color=blue&color=black&color=brown | R=100&G=200&B=150
+simple | false | n/a | blue | blue,black,brown | R,100,G,200,B,150
+simple | true | n/a | blue | blue,black,brown | R=100,G=200,B=150
+spaceDelimited | false | n/a | n/a | blue%20black%20brown | R%20100%20G%20200%20B%20150
+pipeDelimited | false | n/a | n/a | blue\|black\|brown | R\|100\|G\|200|G\|150
+deepObject | true | n/a | n/a | n/a | color[R]=100&color[G]=200&color[B]=150
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Parameter Object Examples
+
+A header parameter with an array of 64 bit integer numbers:
+
+```json
+{
+ "name": "token",
+ "in": "header",
+ "description": "token to be passed as a header",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "style": "simple"
+}
+```
+
+```yaml
+name: token
+in: header
+description: token to be passed as a header
+required: true
+schema:
+ type: array
+ items:
+ type: integer
+ format: int64
+style: simple
+```
+
+A path parameter of a string value:
+```json
+{
+ "name": "username",
+ "in": "path",
+ "description": "username to fetch",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+name: username
+in: path
+description: username to fetch
+required: true
+schema:
+ type: string
+```
+
+An optional query parameter of a string value, allowing multiple values by repeating the query parameter:
+```json
+{
+ "name": "id",
+ "in": "query",
+ "description": "ID of the object to fetch",
+ "required": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "form",
+ "explode": true
+}
+```
+
+```yaml
+name: id
+in: query
+description: ID of the object to fetch
+required: false
+schema:
+ type: array
+ items:
+ type: string
+style: form
+explode: true
+```
+
+A free-form query parameter, allowing undefined parameters of a specific type:
+```json
+{
+ "in": "query",
+ "name": "freeForm",
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ },
+ },
+ "style": "form"
+}
+```
+
+```yaml
+in: query
+name: freeForm
+schema:
+ type: object
+ additionalProperties:
+ type: integer
+style: form
+```
+
+A complex parameter using `content` to define serialization:
+
+```json
+{
+ "in": "query",
+ "name": "coordinates",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "lat",
+ "long"
+ ],
+ "properties": {
+ "lat": {
+ "type": "number"
+ },
+ "long": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+in: query
+name: coordinates
+content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - lat
+ - long
+ properties:
+ lat:
+ type: number
+ long:
+ type: number
+```
+
+#### Request Body Object
+
+Describes a single request body.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+content | Map[`string`, [Media Type Object](#media-type-object)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+required | `boolean` | Determines if the request body is required in the request. Defaults to `false`.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Request Body Examples
+
+A request body with a referenced model definition.
+```json
+{
+ "description": "user to add to the system",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User Example",
+ "externalValue": "http://foo.bar/examples/user-example.json"
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User example in XML",
+ "externalValue": "http://foo.bar/examples/user-example.xml"
+ }
+ }
+ },
+ "text/plain": {
+ "examples": {
+ "user" : {
+ "summary": "User example in Plain text",
+ "externalValue": "http://foo.bar/examples/user-example.txt"
+ }
+ }
+ },
+ "*/*": {
+ "examples": {
+ "user" : {
+ "summary": "User example in other format",
+ "externalValue": "http://foo.bar/examples/user-example.whatever"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User Example
+ externalValue: 'http://foo.bar/examples/user-example.json'
+ 'application/xml':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User Example in XML
+ externalValue: 'http://foo.bar/examples/user-example.xml'
+ 'text/plain':
+ examples:
+ user:
+ summary: User example in text plain format
+ externalValue: 'http://foo.bar/examples/user-example.txt'
+ '*/*':
+ examples:
+ user:
+ summary: User example in other format
+ externalValue: 'http://foo.bar/examples/user-example.whatever'
+```
+
+A body parameter that is an array of string values:
+```json
+{
+ "description": "user to add to the system",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+required: true
+content:
+ text/plain:
+ schema:
+ type: array
+ items:
+ type: string
+```
+
+
+#### Media Type Object
+Each Media Type Object provides schema and examples for the media type identified by its key.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the type used for the request body.
+example | Any | Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+encoding | Map[`string`, [Encoding Object](#encoding-object)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Media Type Examples
+
+```js
+{
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ },
+ "examples": {
+ "cat" : {
+ "summary": "An example of a cat",
+ "value":
+ {
+ "name": "Fluffy",
+ "petType": "Cat",
+ "color": "White",
+ "gender": "male",
+ "breed": "Persian"
+ }
+ },
+ "dog": {
+ "summary": "An example of a dog with a cat's name",
+ "value" : {
+ "name": "Puma",
+ "petType": "Dog",
+ "color": "Black",
+ "gender": "Female",
+ "breed": "Mixed"
+ },
+ "frog": {
+ "$ref": "#/components/examples/frog-example"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ examples:
+ cat:
+ summary: An example of a cat
+ value:
+ name: Fluffy
+ petType: Cat
+ color: White
+ gender: male
+ breed: Persian
+ dog:
+ summary: An example of a dog with a cat's name
+ value:
+ name: Puma
+ petType: Dog
+ color: Black
+ gender: Female
+ breed: Mixed
+ frog:
+ $ref: "#/components/examples/frog-example"
+```
+
+##### Considerations for File Uploads
+
+In contrast with the 2.0 specification, `file` input/output content in OpenAPI is described with the same semantics as any other schema type. Specifically:
+
+```yaml
+# content transferred with base64 encoding
+schema:
+ type: string
+ format: base64
+```
+
+```yaml
+# content transferred in binary (octet-stream):
+schema:
+ type: string
+ format: binary
+```
+
+These examples apply to either input payloads of file uploads or response payloads.
+
+A `requestBody` for submitting a file in a `POST` operation may look like the following example:
+
+```yaml
+requestBody:
+ content:
+ application/octet-stream:
+ # any media type is accepted, functionally equivalent to `*/*`
+ schema:
+ # a binary file of any type
+ type: string
+ format: binary
+```
+
+In addition, specific media types MAY be specified:
+
+```yaml
+# multiple, specific media types may be specified:
+requestBody:
+ content:
+ # a binary file of type png or jpeg
+ 'image/jpeg':
+ schema:
+ type: string
+ format: binary
+ 'image/png':
+ schema:
+ type: string
+ format: binary
+```
+
+To upload multiple files, a `multipart` media type MUST be used:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ # The property name 'file' will be used for all files.
+ file:
+ type: array
+ items:
+ type: string
+ format: binary
+
+```
+
+##### Support for x-www-form-urlencoded Request Bodies
+
+To submit content using form url encoding via [RFC1866](https://tools.ietf.org/html/rfc1866), the following
+definition may be used:
+
+```yaml
+requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # complex types are stringified to support RFC 1866
+ type: object
+ properties: {}
+```
+
+In this example, the contents in the `requestBody` MUST be stringified per [RFC1866](https://tools.ietf.org/html/rfc1866/) when passed to the server. In addition, the `address` field complex object will be stringified.
+
+When passing complex objects in the `application/x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the [`Encoding Object`](#encoding-object)'s [`style`](#encodingStyle) property as `form`.
+
+##### Special Considerations for `multipart` Content
+
+It is common to use `multipart/form-data` as a `Content-Type` when transferring request bodies to operations. In contrast to 2.0, a `schema` is REQUIRED to define the input parameters to the operation when using `multipart` content. This supports complex structures as well as supporting mechanisms for multiple file uploads.
+
+When passing in `multipart` types, boundaries MAY be used to separate sections of the content being transferred — thus, the following default `Content-Type`s are defined for `multipart`:
+
+* If the property is a primitive, or an array of primitive values, the default Content-Type is `text/plain`
+* If the property is complex, or an array of complex values, the default Content-Type is `application/json`
+* If the property is a `type: string` with `format: binary` or `format: base64` (aka a file object), the default Content-Type is `application/octet-stream`
+
+
+Examples:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # default Content-Type for objects is `application/json`
+ type: object
+ properties: {}
+ profileImage:
+ # default Content-Type for string/binary is `application/octet-stream`
+ type: string
+ format: binary
+ children:
+ # default Content-Type for arrays is based on the `inner` type (text/plain here)
+ type: array
+ items:
+ type: string
+ addresses:
+ # default Content-Type for arrays is based on the `inner` type (object shown, so `application/json` in this example)
+ type: array
+ items:
+ type: '#/components/schemas/Address'
+```
+
+An `encoding` attribute is introduced to give you control over the serialization of parts of `multipart` request bodies. This attribute is _only_ applicable to `multipart` and `application/x-www-form-urlencoded` request bodies.
+
+#### Encoding Object
+
+A single encoding definition applied to a single schema property.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+contentType | `string` | The Content-Type for encoding a specific property. Default value depends on the property type: for `string` with `format` being `binary` – `application/octet-stream`; for other primitive types – `text/plain`; for `object` - `application/json`; for `array` – the default is defined based on the inner type. The value can be a specific media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`), or a comma-separated list of the two types.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | A map allowing additional information to be provided as headers, for example `Content-Disposition`. `Content-Type` is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a `multipart`.
+style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameter-object) for details on the [`style`](#parameterStyle) property. The behavior follows the same values as `query` parameters, including default values. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+explode | `boolean` | When this is true, property values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When [`style`](#encodingStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Encoding Object Example
+
+```yaml
+requestBody:
+ content:
+ multipart/mixed:
+ schema:
+ type: object
+ properties:
+ id:
+ # default is text/plain
+ type: string
+ format: uuid
+ address:
+ # default is application/json
+ type: object
+ properties: {}
+ historyMetadata:
+ # need to declare XML format!
+ description: metadata in XML format
+ type: object
+ properties: {}
+ profileImage:
+ # default is application/octet-stream, need to declare an image type only!
+ type: string
+ format: binary
+ encoding:
+ historyMetadata:
+ # require XML Content-Type in utf-8 encoding
+ contentType: application/xml; charset=utf-8
+ profileImage:
+ # only accept png/jpeg
+ contentType: image/png, image/jpeg
+ headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+```
+
+#### Responses Object
+
+A container for the expected responses of an operation.
+The container maps a HTTP response code to the expected response.
+
+The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance.
+However, documentation is expected to cover a successful operation response and any known errors.
+
+The `default` MAY be used as a default response object for all HTTP codes
+that are not covered individually by the specification.
+
+The `Responses Object` MUST contain at least one response code, and it
+SHOULD be the response for a successful operation call.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+default | [Response Object](#response-object) \| [Reference Object](#reference-object) | The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. A [Reference Object](#reference-object) can link to a response that the [OpenAPI Object's components/responses](#componentsResponses) section defines.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+[HTTP Status Code](#http-status-codes) | [Response Object](#response-object) \| [Reference Object](#reference-object) | Any [HTTP status code](#http-status-codes) can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. A [Reference Object](#reference-object) can link to a response that is defined in the [OpenAPI Object's components/responses](#componentsResponses) section. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. The following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response range is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Responses Object Example
+
+A 200 response for a successful operation and a default response for others (implying an error):
+
+```json
+{
+ "200": {
+ "description": "a pet to be returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "Unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+'200':
+ description: a pet to be returned
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+```
+
+#### Response Object
+Describes a single response from an API Operation, including design-time, static
+`links` to operations based on the response.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | **REQUIRED**. A short description of the response. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | Maps a header name to its definition. [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing descriptions of potential response payloads. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for [Component Objects](#components-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Response Object Examples
+
+Response of an array of a complex type:
+
+```json
+{
+ "description": "A complex object array response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/VeryComplexType"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A complex object array response
+content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/VeryComplexType'
+```
+
+Response with a string type:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+```
+
+Plain text response with headers:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "headers": {
+ "X-Rate-Limit-Limit": {
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Remaining": {
+ "description": "The number of remaining requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Reset": {
+ "description": "The number of seconds left in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+ example: 'whoa!'
+headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Remaining:
+ description: The number of remaining requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Reset:
+ description: The number of seconds left in the current period
+ schema:
+ type: integer
+```
+
+Response with no return value:
+
+```json
+{
+ "description": "object created"
+}
+```
+
+```yaml
+description: object created
+```
+
+#### Callback Object
+
+A map of possible out-of band callbacks related to the parent operation.
+Each value in the map is a [Path Item Object](#path-item-object) that describes a set of requests that may be initiated by the API provider and the expected responses.
+The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+{expression} | [Path Item Object](#path-item-object) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Key Expression
+
+The key that identifies the [Path Item Object](#path-item-object) is a [runtime expression](#runtime-expressions) that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.
+A simple example might be `$request.body#/url`.
+However, using a [runtime expression](#runtime-expressions) the complete HTTP message can be accessed.
+This includes accessing any part of a body that a JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) can reference.
+
+For example, given the following HTTP request:
+
+```http
+POST /subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning HTTP/1.1
+Host: example.org
+Content-Type: application/json
+Content-Length: 187
+
+{
+ "failedUrl" : "http://clientdomain.com/failed",
+ "successUrls" : [
+ "http://clientdomain.com/fast",
+ "http://clientdomain.com/medium",
+ "http://clientdomain.com/slow"
+ ]
+}
+
+201 Created
+Location: http://example.org/subscription/1
+```
+
+The following examples show how the various expressions evaluate, assuming the callback operation has a path parameter named `eventType` and a query parameter named `queryUrl`.
+
+Expression | Value
+---|:---
+$url | http://example.org/subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning
+$method | POST
+$request.path.eventType | myevent
+$request.query.queryUrl | http://clientdomain.com/stillrunning
+$request.header.content-Type | application/json
+$request.body#/failedUrl | http://clientdomain.com/stillrunning
+$request.body#/successUrls/2 | http://clientdomain.com/medium
+$response.header.Location | http://example.org/subscription/1
+
+
+##### Callback Object Example
+
+The following example shows a callback to the URL specified by the `id` and `email` property in the request body.
+
+```yaml
+myWebhook:
+ 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: webhook successfully processed and no retries will be performed
+```
+
+
+#### Example Object
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+summary | `string` | Short description for the example.
+description | `string` | Long description for the example. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+value | Any | Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
+externalValue | `string` | A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `externalValue` field are mutually exclusive.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+In all cases, the example value is expected to be compatible with the type schema
+of its associated value. Tooling implementations MAY choose to
+validate compatibility automatically, and reject the example value(s) if incompatible.
+
+##### Example Object Example
+
+```yaml
+# in a model
+schemas:
+ properties:
+ name:
+ type: string
+ examples:
+ name:
+ $ref: http://example.org/petapi-examples/openapi.json#/components/examples/name-example
+
+# in a request body:
+ requestBody:
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Address'
+ examples:
+ foo:
+ summary: A foo example
+ value: {"foo": "bar"}
+ bar:
+ summary: A bar example
+ value: {"bar": "baz"}
+ 'application/xml':
+ examples:
+ xmlExample:
+ summary: This is an example in XML
+ externalValue: 'http://example.org/examples/address-example.xml'
+ 'text/plain':
+ examples:
+ textExample:
+ summary: This is a text example
+ externalValue: 'http://foo.bar/examples/address-example.txt'
+
+
+# in a parameter
+ parameters:
+ - name: 'zipCode'
+ in: 'query'
+ schema:
+ type: 'string'
+ format: 'zip-code'
+ examples:
+ zip-example:
+ $ref: '#/components/examples/zip-example'
+
+# in a response
+ responses:
+ '200':
+ description: your car appointment has been booked
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SuccessResponse'
+ examples:
+ confirmation-success:
+ $ref: '#/components/examples/confirmation-success'
+```
+
+
+#### Link Object
+
+The `Link object` represents a possible design-time link for a response.
+The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
+
+Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response.
+
+For computing links, and providing instructions to execute them, a [runtime expression](#runtime-expressions) is used for accessing values in an operation and using them as parameters while invoking the linked operation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+operationRef | `string` | A relative or absolute reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an [Operation Object](#operation-object). Relative `operationRef` values MAY be used to locate an existing [Operation Object](#operation-object) in the OpenAPI definition.
+operationId | `string` | The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
+parameters | Map[`string`, Any \| [{expression}](#runtime-expressions)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path.id).
+requestBody | Any \| [{expression}](#runtime-expressions) | A literal value or [{expression}](#runtime-expressions) to use as a request body when calling the target operation.
+description | `string` | A description of the link. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+server | [Server Object](#server-object) | A server object to be used by the target operation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+A linked operation MUST be identified using either an `operationRef` or `operationId`.
+In the case of an `operationId`, it MUST be unique and resolved in the scope of the OAS document.
+Because of the potential for name clashes, the `operationRef` syntax is preferred
+for specifications with external references.
+
+##### Examples
+
+Computing a link from a request operation where the `$request.path.id` is used to pass a request parameter to the linked operation.
+
+```yaml
+paths:
+ /users/{id}:
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ get:
+ responses:
+ '200':
+ description: the user being returned
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ uuid: # the unique user id
+ type: string
+ format: uuid
+ links:
+ address:
+ # the target link operationId
+ operationId: getUserAddress
+ parameters:
+ # get the `id` field from the request path parameter named `id`
+ userId: $request.path.id
+ # the path item of the linked operation
+ /users/{userid}/address:
+ parameters:
+ - name: userid
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ # linked operation
+ get:
+ operationId: getUserAddress
+ responses:
+ '200':
+ description: the user's address
+```
+
+When a runtime expression fails to evaluate, no parameter value is passed to the target operation.
+
+Values from the response body can be used to drive a linked operation.
+
+```yaml
+links:
+ address:
+ operationId: getUserAddressByUUID
+ parameters:
+ # get the `uuid` field from the `uuid` field in the response body
+ userUuid: $response.body#/uuid
+```
+
+Clients follow all links at their discretion.
+Neither permissions, nor the capability to make a successful call to that link, is guaranteed
+solely by the existence of a relationship.
+
+
+##### OperationRef Examples
+
+As references to `operationId` MAY NOT be possible (the `operationId` is an optional
+value), references MAY also be made through a relative `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: '#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+or an absolute `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
+using JSON references.
+
+
+##### Runtime Expressions
+
+Runtime expressions allow defining values based on information that will only be available within the HTTP message in an actual API call.
+This mechanism is used by [Link Objects](#link-object) and [Callback Objects](#callback-object).
+
+The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
+
+```
+ expression = ( "$url" | "$method" | "$statusCode" | "$request." source | "$response." source )
+ source = ( header-reference | query-reference | path-reference | body-reference )
+ header-reference = "header." token
+ query-reference = "query." name
+ path-reference = "path." name
+ body-reference = "body" ["#" fragment]
+ fragment = a JSON Pointer [RFC 6901](https://tools.ietf.org/html/rfc6901)
+ name = *( char )
+ char = as per RFC [7159](https://tools.ietf.org/html/rfc7159#section-7)
+ token = as per RFC [7230](https://tools.ietf.org/html/rfc7230#section-3.2.6)
+```
+
+The `name` identifier is case-sensitive, whereas `token` is not.
+
+The table below provides examples of runtime expressions and examples of their use in a value:
+
+##### Examples
+
+Source Location | example expression | notes
+---|:---|:---|
+HTTP Method | `$method` | The allowable values for the `$method` will be those for the HTTP operation.
+Requested media type | `$request.header.accept` |
+Request parameter | `$request.path.id` | Request parameters MUST be declared in the `parameters` section of the parent operation or they cannot be evaluated. This includes request headers.
+Request body property | `$request.body#/user/uuid` | In operations which accept payloads, references may be made to portions of the `requestBody` or the entire body.
+Request URL | `$url` |
+Response value | `$response.body#/status` | In operations which return payloads, references may be made to portions of the response body or the entire body.
+Response header | `$response.header.Server` | Single header values only are available
+
+Runtime expressions preserve the type of the referenced value.
+Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
+
+#### Header Object
+
+The Header Object follows the structure of the [Parameter Object](#parameter-object) with the following changes:
+
+1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
+1. `in` MUST NOT be specified, it is implicitly in `header`.
+1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, [`style`](#parameterStyle)).
+
+##### Header Object Example
+
+A simple header of type `integer`:
+
+```json
+{
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+}
+```
+
+```yaml
+description: The number of allowed requests in the current period
+schema:
+ type: integer
+```
+
+#### Tag Object
+
+Adds metadata to a single tag that is used by the [Operation Object](#operation-object).
+It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the tag.
+description | `string` | A short description for the tag. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this tag.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Tag Object Example
+
+```json
+{
+ "name": "pet",
+ "description": "Pets operations"
+}
+```
+
+```yaml
+name: pet
+description: Pets operations
+```
+
+
+#### Reference Object
+
+A simple object to allow referencing other components in the specification, internally and externally.
+
+The Reference Object is defined by [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) and follows the same structure, behavior and rules.
+
+For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | **REQUIRED**. The reference string.
+
+This object cannot be extended with additional properties and any properties added SHALL be ignored.
+
+##### Reference Object Example
+
+```json
+{
+ "$ref": "#/components/schemas/Pet"
+}
+```
+
+```yaml
+$ref: '#/components/schemas/Pet'
+```
+
+##### Relative Schema Document Example
+```json
+{
+ "$ref": "Pet.json"
+}
+```
+
+```yaml
+$ref: Pet.yaml
+```
+
+##### Relative Documents With Embedded Schema Example
+```json
+{
+ "$ref": "definitions.json#/Pet"
+}
+```
+
+```yaml
+$ref: definitions.yaml#/Pet
+```
+
+#### Schema Object
+
+The Schema Object allows the definition of input and output data types.
+These types can be objects, but also primitives and arrays.
+This object is an extended subset of the [JSON Schema Specification Wright Draft 00](http://json-schema.org/).
+
+For more information about the properties, see [JSON Schema Core](https://tools.ietf.org/html/draft-wright-json-schema-00) and [JSON Schema Validation](https://tools.ietf.org/html/draft-wright-json-schema-validation-00).
+Unless stated otherwise, the property definitions follow the JSON Schema.
+
+##### Properties
+
+The following properties are taken directly from the JSON Schema definition and follow the same specifications:
+
+- title
+- multipleOf
+- maximum
+- exclusiveMaximum
+- minimum
+- exclusiveMinimum
+- maxLength
+- minLength
+- pattern (This string SHOULD be a valid regular expression, according to the [ECMA 262 regular expression](https://www.ecma-international.org/ecma-262/5.1/#sec-7.8.5) dialect)
+- maxItems
+- minItems
+- uniqueItems
+- maxProperties
+- minProperties
+- required
+- enum
+
+The following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
+- type - Value MUST be a string. Multiple types via an array are not supported.
+- allOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- oneOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- anyOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- not - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- items - Value MUST be an object and not an array. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema. `items` MUST be present if the `type` is `array`.
+- properties - Property definitions MUST be a [Schema Object](#schema-object) and not a standard JSON Schema (inline or referenced).
+- additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- description - [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+- format - See [Data Type Formats](#dataTypeFormat) for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
+- default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if `type` is `string`, then `default` can be `"foo"` but cannot be `1`.
+
+Alternatively, any time a Schema Object can be used, a [Reference Object](#reference-object) can be used in its place. This allows referencing definitions instead of defining them inline.
+
+Additional properties defined by the JSON Schema specification that are not mentioned here are strictly unsupported.
+
+Other than the JSON Schema subset fields, the following fields MAY be used for further schema documentation:
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+nullable | `boolean` | Allows sending a `null` value for the defined schema. Default value is `false`.
+discriminator | [Discriminator Object](#discriminator-object) | Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](#composition-and-inheritance-polymorphism) for more details.
+readOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as `readOnly` being `true` and is in the `required` list, the `required` will take effect on the response only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
+writeOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "write only". Therefore, it MAY be sent as part of a request but SHOULD NOT be sent as part of the response. If the property is marked as `writeOnly` being `true` and is in the `required` list, the `required` will take effect on the request only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
+xml | [XML Object](#xml-object) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this schema.
+example | Any | A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
+ deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+###### Composition and Inheritance (Polymorphism)
+
+The OpenAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition.
+`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
+
+While composition offers model extensibility, it does not imply a hierarchy between the models.
+To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
+When used, the `discriminator` will be the name of the property that decides which schema definition validates the structure of the model.
+As such, the `discriminator` field MUST be a required field.
+There are two ways to define the value of a discriminator for an inheriting instance.
+- Use the schema name.
+- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
+As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.
+
+###### XML Modeling
+
+The [xml](#schemaXml) property allows extra definitions when translating the JSON definition to XML.
+The [XML Object](#xml-object) contains additional information about the available options.
+
+##### Schema Object Examples
+
+###### Primitive Sample
+
+```json
+{
+ "type": "string",
+ "format": "email"
+}
+```
+
+```yaml
+type: string
+format: email
+```
+
+###### Simple Model
+
+```json
+{
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "address": {
+ "$ref": "#/components/schemas/Address"
+ },
+ "age": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ }
+ }
+}
+```
+
+```yaml
+type: object
+required:
+- name
+properties:
+ name:
+ type: string
+ address:
+ $ref: '#/components/schemas/Address'
+ age:
+ type: integer
+ format: int32
+ minimum: 0
+```
+
+###### Model with Map/Dictionary Properties
+
+For a simple string to string mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ type: string
+```
+
+For a string to model mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/ComplexModel"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ $ref: '#/components/schemas/ComplexModel'
+```
+
+###### Model with Example
+
+```json
+{
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "example": {
+ "name": "Puma",
+ "id": 1
+ }
+}
+```
+
+```yaml
+type: object
+properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+required:
+- name
+example:
+ name: Puma
+ id: 1
+```
+
+###### Models with Composition
+
+```json
+{
+ "components": {
+ "schemas": {
+ "ErrorModel": {
+ "type": "object",
+ "required": [
+ "message",
+ "code"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 600
+ }
+ }
+ },
+ "ExtendedErrorModel": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ErrorModel"
+ },
+ {
+ "type": "object",
+ "required": [
+ "rootCause"
+ ],
+ "properties": {
+ "rootCause": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ ErrorModel:
+ type: object
+ required:
+ - message
+ - code
+ properties:
+ message:
+ type: string
+ code:
+ type: integer
+ minimum: 100
+ maximum: 600
+ ExtendedErrorModel:
+ allOf:
+ - $ref: '#/components/schemas/ErrorModel'
+ - type: object
+ required:
+ - rootCause
+ properties:
+ rootCause:
+ type: string
+```
+
+###### Models with Polymorphism Support
+
+```json
+{
+ "components": {
+ "schemas": {
+ "Pet": {
+ "type": "object",
+ "discriminator": {
+ "propertyName": "petType"
+ },
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "petType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "petType"
+ ]
+ },
+ "Cat": {
+ "description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "huntingSkill": {
+ "type": "string",
+ "description": "The measured skill for hunting",
+ "default": "lazy",
+ "enum": [
+ "clueless",
+ "lazy",
+ "adventurous",
+ "aggressive"
+ ]
+ }
+ },
+ "required": [
+ "huntingSkill"
+ ]
+ }
+ ]
+ },
+ "Dog": {
+ "description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "packSize": {
+ "type": "integer",
+ "format": "int32",
+ "description": "the size of the pack the dog is from",
+ "default": 0,
+ "minimum": 0
+ }
+ },
+ "required": [
+ "packSize"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ discriminator:
+ propertyName: petType
+ properties:
+ name:
+ type: string
+ petType:
+ type: string
+ required:
+ - name
+ - petType
+ Cat: ## "Cat" will be used as the discriminator value
+ description: A representation of a cat
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ huntingSkill:
+ type: string
+ description: The measured skill for hunting
+ enum:
+ - clueless
+ - lazy
+ - adventurous
+ - aggressive
+ required:
+ - huntingSkill
+ Dog: ## "Dog" will be used as the discriminator value
+ description: A representation of a dog
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ packSize:
+ type: integer
+ format: int32
+ description: the size of the pack the dog is from
+ default: 0
+ minimum: 0
+ required:
+ - packSize
+```
+
+#### Discriminator Object
+
+When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
+
+When using the discriminator, _inline_ schemas will not be considered.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value.
+ mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or references.
+
+The discriminator attribute is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`.
+
+In OAS 3.0, a response payload MAY be described to be exactly one of any number of types:
+
+```
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+```
+
+which means the payload _MUST_, by validation, match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. In this case, a discriminator MAY act as a "hint" to shortcut validation and selection of the matching schema which may be a costly operation, depending on the complexity of the schema. We can then describe exactly which field tells us which schema to use:
+
+
+```
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ discriminator:
+ propertyName: pet_type
+```
+
+The expectation now is that a property with name `pet_type` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OAS document. Thus the response payload:
+
+```
+{
+ "id": 12345,
+ "pet_type": "Cat"
+}
+```
+
+Will indicate that the `Cat` schema be used in conjunction with this payload.
+
+In scenarios where the value of the discriminator field does not match the schema name or implicit mapping is not possible, an optional `mapping` definition MAY be used:
+
+```
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ - $ref: 'https://gigantic-server.com/schemas/Monster/schema.json'
+ discriminator:
+ propertyName: pet_type
+ mapping:
+ dog: '#/components/schemas/Dog'
+ monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
+```
+
+Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Mapping keys MUST be string values, but tooling MAY convert response values to strings for comparison.
+
+When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
+
+In both the `oneOf` and `anyOf` use cases, all possible schemas MUST be listed explicitly. To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas comprising the parent schema in an `allOf` construct may be used as an alternate schema.
+
+For example:
+
+```
+components:
+ schemas:
+ Pet:
+ type: object
+ required:
+ - pet_type
+ properties:
+ pet_type:
+ type: string
+ discriminator:
+ propertyName: pet_type
+ mapping:
+ cachorro: Dog
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Cat`
+ properties:
+ name:
+ type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Dog`
+ properties:
+ bark:
+ type: string
+ Lizard:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Lizard`
+ properties:
+ lovesRocks:
+ type: boolean
+```
+
+a payload like this:
+
+```
+{
+ "pet_type": "Cat",
+ "name": "misty"
+}
+```
+
+will indicate that the `Cat` schema be used. Likewise this schema:
+
+```
+{
+ "pet_type": "cachorro",
+ "bark": "soft"
+}
+```
+
+will map to `Dog` because of the definition in the `mappings` element.
+
+
+#### XML Object
+
+A metadata object that allows for more fine-tuned XML model definitions.
+
+When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information.
+See examples for expected behavior.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `array` (outside the `items`), it will affect the wrapping element and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored.
+namespace | `string` | The URI of the namespace definition. Value MUST be in the form of an absolute URI.
+prefix | `string` | The prefix to be used for the [name](#xmlName).
+attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
+wrapped | `boolean` | MAY be used only for an array definition. Signifies whether the array is wrapped (for example, ``) or unwrapped (``). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### XML Object Examples
+
+The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schema-object) with a sample of the XML representation of it.
+
+###### No XML Element
+
+Basic string property:
+
+```json
+{
+ "animals": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+```
+
+```xml
+...
+```
+
+Basic string array property ([`wrapped`](#xmlWrapped) is `false` by default):
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+```
+
+```xml
+...
+...
+...
+```
+
+###### XML Name Replacement
+
+```json
+{
+ "animals": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+...
+```
+
+
+###### XML Attribute, Prefix and Namespace
+
+In this example, a full model definition is shown.
+
+```json
+{
+ "Person": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "xml": {
+ "attribute": true
+ }
+ },
+ "name": {
+ "type": "string",
+ "xml": {
+ "namespace": "http://example.com/schema/sample",
+ "prefix": "sample"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+Person:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int32
+ xml:
+ attribute: true
+ name:
+ type: string
+ xml:
+ namespace: http://example.com/schema/sample
+ prefix: sample
+```
+
+```xml
+
+ example
+
+```
+
+###### XML Arrays
+
+Changing the element names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+value
+value
+```
+
+The external `name` property has no effect on the XML:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+```
+
+```xml
+value
+value
+```
+
+Even when the array is wrapped, if a name is not explicitly defined, the same name will be used both internally and externally:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+To overcome the naming problem in the example above, the following definition can be used:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+Affecting both internal and external names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+If we change the external element but not the internal ones:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+#### Security Scheme Object
+
+Defines a security scheme that can be used by the operations.
+Supported schemes are HTTP authentication, an API key (either as a header or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in [RFC6749](https://tools.ietf.org/html/rfc6749), and [OpenID Connect Discovery](https://tools.ietf.org/html/draft-ietf-oauth-discovery-06).
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+type | `string` | Any | **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
+description | `string` | Any | A short description for security scheme. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+name | `string` | `apiKey` | **REQUIRED**. The name of the header, query or cookie parameter to be used.
+in | `string` | `apiKey` | **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"` or `"cookie"`.
+scheme | `string` | `http` | **REQUIRED**. The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-5.1).
+bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
+flows | [OAuth Flows Object](#oauth-flows-object) | `oauth2` | **REQUIRED**. An object containing configuration information for the flow types supported.
+openIdConnectUrl | `string` | `openIdConnect` | **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Security Scheme Object Example
+
+###### Basic Authentication Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "basic"
+}
+```
+
+```yaml
+type: http
+scheme: basic
+```
+
+###### API Key Sample
+
+```json
+{
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+}
+```
+
+```yaml
+type: apiKey
+name: api_key
+in: header
+```
+
+###### JWT Bearer Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "bearer",
+ "bearerFormat": "JWT",
+}
+```
+
+```yaml
+type: http
+scheme: bearer
+bearerFormat: JWT
+```
+
+###### Implicit OAuth2 Sample
+
+```json
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```yaml
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+#### OAuth Flows Object
+
+Allows configuration of the supported OAuth Flows.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+implicit| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Implicit flow
+password| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Resource Owner Password flow
+clientCredentials| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
+authorizationCode| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### OAuth Flow Object
+
+Configuration details for a supported OAuth Flow
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL.
+tokenUrl | `string` | `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`) | **REQUIRED**. The token URL to be used for this flow. This MUST be in the form of a URL.
+refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
+scopes | Map[`string`, `string`] | `oauth2` | **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### OAuth Flow Object Examples
+
+```JSON
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ },
+ "authorizationCode": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "tokenUrl": "https://example.com/api/oauth/token",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```YAML
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ authorizationCode:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+
+#### Security Requirement Object
+
+Lists the required security schemes to execute this operation.
+The name used for each property MUST correspond to a security scheme declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object).
+
+Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized.
+This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
+
+When a list of Security Requirement Objects is defined on the [Open API object](#openapi-object) or [Operation Object](#operation-object), only one of Security Requirement Objects in the list needs to be satisfied to authorize the request.
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.
+
+##### Security Requirement Object Examples
+
+###### Non-OAuth2 Security Requirement
+
+```json
+{
+ "api_key": []
+}
+```
+
+```yaml
+api_key: []
+```
+
+###### OAuth2 Security Requirement
+
+```json
+{
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+}
+```
+
+```yaml
+petstore_auth:
+- write:pets
+- read:pets
+```
+
+### Specification Extensions
+
+While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
+
+The extensions properties are implemented as patterned fields that are always prefixed by `"x-"`.
+
+Field Pattern | Type | Description
+---|:---:|---
+^x- | Any | Allows extensions to the OpenAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. Can have any valid JSON format value.
+
+The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).
+
+### Security Filtering
+
+Some objects in the OpenAPI Specification MAY be declared and remain empty, or be completely removed, even though they are inherently the core of the API documentation.
+
+The reasoning is to allow an additional layer of access control over the documentation.
+While not part of the specification itself, certain libraries MAY choose to allow access to parts of the documentation based on some form of authentication/authorization.
+
+Two examples of this:
+
+1. The [Paths Object](#paths-object) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#info-object) which may contain additional information regarding authentication.
+2. The [Path Item Object](#path-item-object) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different than hiding the path itself from the [Paths Object](#paths-object), so the user will not be aware of its existence. This allows the documentation provider to finely control what the viewer can see.
+
+## Appendix A: Revision History
+
+Version | Date | Notes
+--- | --- | ---
+3.0.1 | 2017-12-06 | Patch release of the OpenAPI Specification 3.0.1
+3.0.0 | 2017-07-26 | Release of the OpenAPI Specification 3.0.0
+3.0.0-rc2 | 2017-06-16 | rc2 of the 3.0 specification
+3.0.0-rc1 | 2017-04-27 | rc1 of the 3.0 specification
+3.0.0-rc0 | 2017-02-28 | Implementer's Draft of the 3.0 specification
+2.0 | 2015-12-31 | Donation of Swagger 2.0 to the Open API Initiative
+2.0 | 2014-09-08 | Release of Swagger 2.0
+1.2 | 2014-03-14 | Initial release of the formal document.
+1.1 | 2012-08-22 | Release of Swagger 1.1
+1.0 | 2011-08-10 | First release of the Swagger Specification
diff --git a/versions/3.0.2.md b/versions/3.0.2.md
new file mode 100644
index 0000000000..ff86a527ce
--- /dev/null
+++ b/versions/3.0.2.md
@@ -0,0 +1,3412 @@
+# OpenAPI Specification
+
+#### Version 3.0.2
+
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
+
+This document is licensed under [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).
+
+## Introduction
+
+The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.
+
+An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
+
+## Table of Contents
+
+
+- [Definitions](#definitions)
+ - [OpenAPI Document](#openapi-document)
+ - [Path Templating](#path-templating)
+ - [Media Types](#media-types)
+ - [HTTP Status Codes](#http-status-codes)
+- [Specification](#specification)
+ - [Versions](#versions)
+ - [Format](#format)
+ - [Document Structure](#document-structure)
+ - [Data Types](#data-types)
+ - [Rich Text Formatting](#rich-text-formatting)
+ - [Relative References In URLs](#relative-references-in-urls)
+ - [Schema](#schema)
+ - [OpenAPI Object](#openapi-object)
+ - [Info Object](#info-object)
+ - [Contact Object](#contact-object)
+ - [License Object](#license-object)
+ - [Server Object](#server-object)
+ - [Server Variable Object](#server-variable-object)
+ - [Components Object](#components-object)
+ - [Paths Object](#paths-object)
+ - [Path Item Object](#path-item-object)
+ - [Operation Object](#operation-object)
+ - [External Documentation Object](#external-documentation-object)
+ - [Parameter Object](#parameter-object)
+ - [Request Body Object](#request-body-object)
+ - [Media Type Object](#media-type-object)
+ - [Encoding Object](#encoding-object)
+ - [Responses Object](#responses-object)
+ - [Response Object](#response-object)
+ - [Callback Object](#callback-object)
+ - [Example Object](#example-object)
+ - [Link Object](#link-object)
+ - [Header Object](#header-object)
+ - [Tag Object](#tag-object)
+ - [Reference Object](#reference-object)
+ - [Schema Object](#schema-object)
+ - [Discriminator Object](#discriminator-object)
+ - [XML Object](#xml-object)
+ - [Security Scheme Object](#security-scheme-object)
+ - [OAuth Flows Object](#oauth-flows-object)
+ - [OAuth Flow Object](#oauth-flow-object)
+ - [Security Requirement Object](#security-requirement-object)
+ - [Specification Extensions](#specification-extensions)
+ - [Security Filtering](#security-filtering)
+- [Appendix A: Revision History](#appendix-a-revision-history)
+
+
+
+
+## Definitions
+
+##### OpenAPI Document
+A document (or set of documents) that defines or describes an API. An OpenAPI definition uses and conforms to the OpenAPI Specification.
+
+##### Path Templating
+Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.
+
+##### Media Types
+Media type definitions are spread across several resources.
+The media type definitions SHOULD be in compliance with [RFC6838](https://tools.ietf.org/html/rfc6838).
+
+Some examples of possible media type definitions:
+```
+ text/plain; charset=utf-8
+ application/json
+ application/vnd.github+json
+ application/vnd.github.v3+json
+ application/vnd.github.v3.raw+json
+ application/vnd.github.v3.text+json
+ application/vnd.github.v3.html+json
+ application/vnd.github.v3.full+json
+ application/vnd.github.v3.diff
+ application/vnd.github.v3.patch
+```
+##### HTTP Status Codes
+The HTTP Status Codes are used to indicate the status of the executed operation.
+The available status codes are defined by [RFC7231](https://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
+
+## Specification
+
+### Versions
+
+The OpenAPI Specification is versioned using [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) (semver) and follows the semver specification.
+
+The `major`.`minor` portion of the semver (for example `3.0`) SHALL designate the OAS feature set. Typically, *`.patch`* versions address errors in this document, not the feature set. Tooling which supports OAS 3.0 SHOULD be compatible with all OAS 3.0.\* versions. The patch version SHOULD NOT be considered by tooling, making no distinction between `3.0.0` and `3.0.1` for example.
+
+Subsequent minor version releases of the OpenAPI Specification (incrementing the `minor` version number) SHOULD NOT interfere with tooling developed to a lower minor version and same major version. Thus a hypothetical `3.1.0` specification SHOULD be usable with tooling designed for `3.0.0`.
+
+An OpenAPI document compatible with OAS 3.\*.\* contains a required [`openapi`](#oasVersion) field which designates the semantic version of the OAS that it uses. (OAS 2.0 documents contain a top-level version field named [`swagger`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swaggerObject) and value `"2.0"`.)
+
+### Format
+
+An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
+
+For example, if a field has an array value, the JSON array representation will be used:
+
+```json
+{
+ "field": [ 1, 2, 3 ]
+}
+```
+All field names in the specification are **case sensitive**.
+This includes all fields that are used as keys in a map, except where explicitly noted that keys are **case insensitive**.
+
+The schema exposes two types of fields: Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name.
+
+Patterned fields MUST have unique names within the containing object.
+
+In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](http://www.yaml.org/spec/1.2/spec.html) is RECOMMENDED along with some additional constraints:
+
+- Tags MUST be limited to those allowed by the [JSON Schema ruleset](http://www.yaml.org/spec/1.2/spec.html#id2803231).
+- Keys used in YAML maps MUST be limited to a scalar string, as defined by the [YAML Failsafe schema ruleset](http://yaml.org/spec/1.2/spec.html#id2802346).
+
+**Note:** While APIs may be defined by OpenAPI documents in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
+
+### Document Structure
+
+An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the user. In the latter case, `$ref` fields MUST be used in the specification to reference those parts as follows from the [JSON Schema](http://json-schema.org) definitions.
+
+It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `openapi.yaml`.
+
+### Data Types
+
+Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
+Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
+`null` is not supported as a type (see [`nullable`](#schemaNullable) for an alternative solution).
+Models are defined using the [Schema Object](#schema-object), which is an extended subset of JSON Schema Specification Wright Draft 00.
+
+Primitives have an optional modifier property: `format`.
+OAS uses several known formats to define in fine detail the data type being used.
+However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value.
+Formats such as `"email"`, `"uuid"`, and so on, MAY be used even though undefined by this specification.
+Types that are not accompanied by a `format` property follow the type definition in the JSON Schema. Tools that do not recognize a specific `format` MAY default back to the `type` alone, as if the `format` is not specified.
+
+The formats defined by the OAS are:
+
+[`type`](#data-types) | [`format`](#dataTypeFormat) | Comments
+------ | -------- | --------
+`integer` | `int32` | signed 32 bits
+`integer` | `int64` | signed 64 bits (a.k.a long)
+`number` | `float` | |
+`number` | `double` | |
+`string` | | |
+`string` | `byte` | base64 encoded characters
+`string` | `binary` | any sequence of octets
+`boolean` | | |
+`string` | `date` | As defined by `full-date` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
+`string` | `date-time` | As defined by `date-time` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
+`string` | `password` | A hint to UIs to obscure input.
+
+
+### Rich Text Formatting
+Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
+Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](http://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
+
+### Relative References in URLs
+
+Unless specified otherwise, all properties that are URLs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+Relative references are resolved using the URLs defined in the [`Server Object`](#server-object) as a Base URI.
+
+Relative references used in `$ref` are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), using the URL of the current document as the base URI. See also the [Reference Object](#reference-object).
+
+### Schema
+
+In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
+
+#### OpenAPI Object
+
+This is the root document object of the [OpenAPI document](#openapi-document).
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+openapi | `string` | **REQUIRED**. This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenAPI Specification version](#versions) that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is *not* related to the API [`info.version`](#infoVersion) string.
+info | [Info Object](#info-object) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
+servers | [[Server Object](#server-object)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#serverUrl) value of `/`.
+paths | [Paths Object](#paths-object) | **REQUIRED**. The available paths and operations for the API.
+components | [Components Object](#components-object) | An element to hold various schemas for the specification.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
+tags | [[Tag Object](#tag-object)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operation-object) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Info Object
+
+The object provides metadata about the API.
+The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+title | `string` | **REQUIRED**. The title of the application.
+description | `string` | A short description of the application. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
+contact | [Contact Object](#contact-object) | The contact information for the exposed API.
+license | [License Object](#license-object) | The license information for the exposed API.
+version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Info Object Example
+
+```json
+{
+ "title": "Sample Pet Store App",
+ "description": "This is a sample server for a pet store.",
+ "termsOfService": "http://example.com/terms/",
+ "contact": {
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+ },
+ "version": "1.0.1"
+}
+```
+
+```yaml
+title: Sample Pet Store App
+description: This is a sample server for a pet store.
+termsOfService: http://example.com/terms/
+contact:
+ name: API Support
+ url: http://www.example.com/support
+ email: support@example.com
+license:
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+version: 1.0.1
+```
+
+#### Contact Object
+
+Contact information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | The identifying name of the contact person/organization.
+url | `string` | The URL pointing to the contact information. MUST be in the format of a URL.
+email | `string` | The email address of the contact person/organization. MUST be in the format of an email address.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Contact Object Example
+
+```json
+{
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+}
+```
+
+```yaml
+name: API Support
+url: http://www.example.com/support
+email: support@example.com
+```
+
+#### License Object
+
+License information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The license name used for the API.
+url | `string` | A URL to the license used for the API. MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### License Object Example
+
+```json
+{
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+}
+```
+
+```yaml
+name: Apache 2.0
+url: https://www.apache.org/licenses/LICENSE-2.0.html
+```
+
+#### Server Object
+
+An object representing a Server.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
+description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+variables | Map[`string`, [Server Variable Object](#server-variable-object)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Server Object Example
+
+A single server would be described as:
+
+```json
+{
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+}
+```
+
+```yaml
+url: https://development.gigantic-server.com/v1
+description: Development server
+```
+
+The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+ },
+ {
+ "url": "https://staging.gigantic-server.com/v1",
+ "description": "Staging server"
+ },
+ {
+ "url": "https://api.gigantic-server.com/v1",
+ "description": "Production server"
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://development.gigantic-server.com/v1
+ description: Development server
+- url: https://staging.gigantic-server.com/v1
+ description: Staging server
+- url: https://api.gigantic-server.com/v1
+ description: Production server
+```
+
+The following shows how variables can be used for a server configuration:
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
+ "description": "The production API server",
+ "variables": {
+ "username": {
+ "default": "demo",
+ "description": "this value is assigned by the service provider, in this example `gigantic-server.com`"
+ },
+ "port": {
+ "enum": [
+ "8443",
+ "443"
+ ],
+ "default": "8443"
+ },
+ "basePath": {
+ "default": "v2"
+ }
+ }
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://{username}.gigantic-server.com:{port}/{basePath}
+ description: The production API server
+ variables:
+ username:
+ # note! no enum here means it is an open value
+ default: demo
+ description: this value is assigned by the service provider, in this example `gigantic-server.com`
+ port:
+ enum:
+ - '8443'
+ - '443'
+ default: '8443'
+ basePath:
+ # open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
+ default: v2
+```
+
+
+#### Server Variable Object
+
+An object representing a Server Variable for server URL template substitution.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+enum | [`string`] | An enumeration of string values to be used if the substitution options are from a limited set.
+default | `string` | **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional.
+description | `string` | An optional description for the server variable. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Components Object
+
+Holds a set of reusable objects for different aspects of the OAS.
+All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
+
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---|---
+ schemas | Map[`string`, [Schema Object](#schema-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Schema Objects](#schema-object).
+ responses | Map[`string`, [Response Object](#response-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Response Objects](#response-object).
+ parameters | Map[`string`, [Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Parameter Objects](#parameter-object).
+ examples | Map[`string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Example Objects](#example-object).
+ requestBodies | Map[`string`, [Request Body Object](#request-body-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Request Body Objects](#request-body-object).
+ headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Header Objects](#header-object).
+ securitySchemes| Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object).
+ links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Link Objects](#link-object).
+ callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Callback Objects](#callback-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`.
+
+Field Name Examples:
+
+```
+User
+User_1
+User_Name
+user-name
+my.org.User
+```
+
+##### Components Object Example
+
+```json
+"components": {
+ "schemas": {
+ "GeneralError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "Category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "Tag": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "skipParam": {
+ "name": "skip",
+ "in": "query",
+ "description": "number of items to skip",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "limitParam": {
+ "name": "limit",
+ "in": "query",
+ "description": "max records to return",
+ "required": true,
+ "schema" : {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ },
+ "responses": {
+ "NotFound": {
+ "description": "Entity not found."
+ },
+ "IllegalInput": {
+ "description": "Illegal input for operation."
+ },
+ "GeneralError": {
+ "description": "General Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GeneralError"
+ }
+ }
+ }
+ }
+ },
+ "securitySchemes": {
+ "api_key": {
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+ },
+ "petstore_auth": {
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "http://example.org/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ GeneralError:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ Category:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ parameters:
+ skipParam:
+ name: skip
+ in: query
+ description: number of items to skip
+ required: true
+ schema:
+ type: integer
+ format: int32
+ limitParam:
+ name: limit
+ in: query
+ description: max records to return
+ required: true
+ schema:
+ type: integer
+ format: int32
+ responses:
+ NotFound:
+ description: Entity not found.
+ IllegalInput:
+ description: Illegal input for operation.
+ GeneralError:
+ description: General Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GeneralError'
+ securitySchemes:
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: http://example.org/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+
+#### Paths Object
+
+Holds the relative paths to the individual endpoints and their operations.
+The path is appended to the URL from the [`Server Object`](#server-object) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#security-filtering).
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+/{path} | [Path Item Object](#path-item-object) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#server-object)'s `url` field in order to construct the full URL. [Path templating](#path-templating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Templating Matching
+
+Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
+
+```
+ /pets/{petId}
+ /pets/mine
+```
+
+The following paths are considered identical and invalid:
+
+```
+ /pets/{petId}
+ /pets/{name}
+```
+
+The following may lead to ambiguous resolution:
+
+```
+ /{entity}/me
+ /books/{id}
+```
+
+##### Paths Object Example
+
+```json
+{
+ "/pets": {
+ "get": {
+ "description": "Returns all pets from the system that the user has access to",
+ "responses": {
+ "200": {
+ "description": "A list of pets.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/pet"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+/pets:
+ get:
+ description: Returns all pets from the system that the user has access to
+ responses:
+ '200':
+ description: A list of pets.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/pet'
+```
+
+#### Path Item Object
+
+Describes the operations available on a single path.
+A Path Item MAY be empty, due to [ACL constraints](#security-filtering).
+The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#path-item-object). If there are conflicts between the referenced definition and this Path Item's definition, the behavior is *undefined*.
+summary| `string` | An optional, string summary, intended to apply to all operations in this path.
+description | `string` | An optional, string description, intended to apply to all operations in this path. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+get | [Operation Object](#operation-object) | A definition of a GET operation on this path.
+put | [Operation Object](#operation-object) | A definition of a PUT operation on this path.
+post | [Operation Object](#operation-object) | A definition of a POST operation on this path.
+delete | [Operation Object](#operation-object) | A definition of a DELETE operation on this path.
+options | [Operation Object](#operation-object) | A definition of a OPTIONS operation on this path.
+head | [Operation Object](#operation-object) | A definition of a HEAD operation on this path.
+patch | [Operation Object](#operation-object) | A definition of a PATCH operation on this path.
+trace | [Operation Object](#operation-object) | A definition of a TRACE operation on this path.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service all operations in this path.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Item Object Example
+
+```json
+{
+ "get": {
+ "description": "Returns pets based on ID",
+ "summary": "Find pets by ID",
+ "operationId": "getPetsById",
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "error payload",
+ "content": {
+ "text/html": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "ID of pet to use",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "simple"
+ }
+ ]
+}
+```
+
+```yaml
+get:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: getPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*' :
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ 'text/html':
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+parameters:
+- name: id
+ in: path
+ description: ID of pet to use
+ required: true
+ schema:
+ type: array
+ style: simple
+ items:
+ type: string
+```
+
+#### Operation Object
+
+Describes a single API operation on a path.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
+summary | `string` | A short summary of what the operation does.
+description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this operation.
+operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+requestBody | [Request Body Object](#request-body-object) \| [Reference Object](#reference-object) | The request body applicable for this operation. The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, `requestBody` SHALL be ignored by consumers.
+responses | [Responses Object](#responses-object) | **REQUIRED**. The list of possible responses as they are returned from executing this operation.
+callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callback-object) that describes a request that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Operation Object Example
+
+```json
+{
+ "tags": [
+ "pet"
+ ],
+ "summary": "Updates a pet in the store with form data",
+ "operationId": "updatePetWithForm",
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/x-www-form-urlencoded": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Updated name of the pet",
+ "type": "string"
+ },
+ "status": {
+ "description": "Updated status of the pet",
+ "type": "string"
+ }
+ },
+ "required": ["status"]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Pet updated.",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ },
+ "405": {
+ "description": "Method Not Allowed",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+}
+```
+
+```yaml
+tags:
+- pet
+summary: Updates a pet in the store with form data
+operationId: updatePetWithForm
+parameters:
+- name: petId
+ in: path
+ description: ID of pet that needs to be updated
+ required: true
+ schema:
+ type: string
+requestBody:
+ content:
+ 'application/x-www-form-urlencoded':
+ schema:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ required:
+ - status
+responses:
+ '200':
+ description: Pet updated.
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+ '405':
+ description: Method Not Allowed
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+security:
+- petstore_auth:
+ - write:pets
+ - read:pets
+```
+
+
+#### External Documentation Object
+
+Allows referencing an external resource for extended documentation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A short description of the target documentation. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+url | `string` | **REQUIRED**. The URL for the target documentation. Value MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### External Documentation Object Example
+
+```json
+{
+ "description": "Find more info here",
+ "url": "https://example.com"
+}
+```
+
+```yaml
+description: Find more info here
+url: https://example.com
+```
+
+#### Parameter Object
+
+Describes a single operation parameter.
+
+A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
+
+##### Parameter Locations
+There are four possible parameter locations specified by the `in` field:
+* path - Used together with [Path Templating](#path-templating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
+* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
+* header - Custom headers that are expected as part of the request. Note that [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive.
+* cookie - Used to pass a specific cookie value to the API.
+
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*.
If [`in`](#parameterIn) is `"path"`, the `name` field MUST correspond to the associated path segment from the [path](#pathsPath) field in the [Paths Object](#paths-object). See [Path Templating](#path-templating) for further information.
If [`in`](#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
For all other cases, the `name` corresponds to the parameter name used by the [`in`](#parameterIn) property.
+in | `string` | **REQUIRED**. The location of the parameter. Possible values are "query", "header", "path" or "cookie".
+description | `string` | A brief description of the parameter. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+required | `boolean` | Determines whether this parameter is mandatory. If the [parameter location](#parameterIn) is "path", this property is **REQUIRED** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
+ deprecated | `boolean` | Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
+ allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows sending a parameter with an empty value. Default value is `false`. If [`style`](#parameterStyle) is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.
+
+The rules for serialization of the parameter are specified in one of two ways.
+For simpler scenarios, a [`schema`](#parameterSchema) and [`style`](#parameterStyle) can describe the structure and syntax of the parameter.
+
+Field Name | Type | Description
+---|:---:|---
+style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
+explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When [`style`](#parameterStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the type used for the parameter.
+example | Any | Example of the media type. The example SHOULD match the specified schema and encoding properties if present. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+
+For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter.
+A parameter MUST contain either a `schema` property, or a `content` property, but not both.
+When `example` or `examples` are provided in conjunction with the `schema` object, the example MUST follow the prescribed serialization strategy for the parameter.
+
+
+Field Name | Type | Description
+---|:---:|---
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
+
+##### Style Values
+
+In order to support common ways of serializing simple parameters, a set of `style` values are defined.
+
+`style` | [`type`](#data-types) | `in` | Comments
+----------- | ------ | -------- | --------
+matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
+label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
+form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` with a `csv` (when `explode` is false) or `multi` (when `explode` is true) value from OpenAPI 2.0.
+simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2). This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0.
+spaceDelimited | `array` | `query` | Space separated array values. This option replaces `collectionFormat` equal to `ssv` from OpenAPI 2.0.
+pipeDelimited | `array` | `query` | Pipe separated array values. This option replaces `collectionFormat` equal to `pipes` from OpenAPI 2.0.
+deepObject | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
+
+
+##### Style Examples
+
+Assume a parameter named `color` has one of the following values:
+
+```
+ string -> "blue"
+ array -> ["blue","black","brown"]
+ object -> { "R": 100, "G": 200, "B": 150 }
+```
+The following table shows examples of rendering differences for each value.
+
+[`style`](#dataTypeFormat) | `explode` | `empty` | `string` | `array` | `object`
+----------- | ------ | -------- | -------- | --------|-------
+matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150
+matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150
+label | false | . | .blue | .blue.black.brown | .R.100.G.200.B.150
+label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150
+form | false | color= | color=blue | color=blue,black,brown | color=R,100,G,200,B,150
+form | true | color= | color=blue | color=blue&color=black&color=brown | R=100&G=200&B=150
+simple | false | n/a | blue | blue,black,brown | R,100,G,200,B,150
+simple | true | n/a | blue | blue,black,brown | R=100,G=200,B=150
+spaceDelimited | false | n/a | n/a | blue%20black%20brown | R%20100%20G%20200%20B%20150
+pipeDelimited | false | n/a | n/a | blue\|black\|brown | R\|100\|G\|200|G\|150
+deepObject | true | n/a | n/a | n/a | color[R]=100&color[G]=200&color[B]=150
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Parameter Object Examples
+
+A header parameter with an array of 64 bit integer numbers:
+
+```json
+{
+ "name": "token",
+ "in": "header",
+ "description": "token to be passed as a header",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "style": "simple"
+}
+```
+
+```yaml
+name: token
+in: header
+description: token to be passed as a header
+required: true
+schema:
+ type: array
+ items:
+ type: integer
+ format: int64
+style: simple
+```
+
+A path parameter of a string value:
+```json
+{
+ "name": "username",
+ "in": "path",
+ "description": "username to fetch",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+name: username
+in: path
+description: username to fetch
+required: true
+schema:
+ type: string
+```
+
+An optional query parameter of a string value, allowing multiple values by repeating the query parameter:
+```json
+{
+ "name": "id",
+ "in": "query",
+ "description": "ID of the object to fetch",
+ "required": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "form",
+ "explode": true
+}
+```
+
+```yaml
+name: id
+in: query
+description: ID of the object to fetch
+required: false
+schema:
+ type: array
+ items:
+ type: string
+style: form
+explode: true
+```
+
+A free-form query parameter, allowing undefined parameters of a specific type:
+```json
+{
+ "in": "query",
+ "name": "freeForm",
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ },
+ },
+ "style": "form"
+}
+```
+
+```yaml
+in: query
+name: freeForm
+schema:
+ type: object
+ additionalProperties:
+ type: integer
+style: form
+```
+
+A complex parameter using `content` to define serialization:
+
+```json
+{
+ "in": "query",
+ "name": "coordinates",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "lat",
+ "long"
+ ],
+ "properties": {
+ "lat": {
+ "type": "number"
+ },
+ "long": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+in: query
+name: coordinates
+content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - lat
+ - long
+ properties:
+ lat:
+ type: number
+ long:
+ type: number
+```
+
+#### Request Body Object
+
+Describes a single request body.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+content | Map[`string`, [Media Type Object](#media-type-object)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+required | `boolean` | Determines if the request body is required in the request. Defaults to `false`.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Request Body Examples
+
+A request body with a referenced model definition.
+```json
+{
+ "description": "user to add to the system",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User Example",
+ "externalValue": "http://foo.bar/examples/user-example.json"
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User example in XML",
+ "externalValue": "http://foo.bar/examples/user-example.xml"
+ }
+ }
+ },
+ "text/plain": {
+ "examples": {
+ "user" : {
+ "summary": "User example in Plain text",
+ "externalValue": "http://foo.bar/examples/user-example.txt"
+ }
+ }
+ },
+ "*/*": {
+ "examples": {
+ "user" : {
+ "summary": "User example in other format",
+ "externalValue": "http://foo.bar/examples/user-example.whatever"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User Example
+ externalValue: 'http://foo.bar/examples/user-example.json'
+ 'application/xml':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User Example in XML
+ externalValue: 'http://foo.bar/examples/user-example.xml'
+ 'text/plain':
+ examples:
+ user:
+ summary: User example in text plain format
+ externalValue: 'http://foo.bar/examples/user-example.txt'
+ '*/*':
+ examples:
+ user:
+ summary: User example in other format
+ externalValue: 'http://foo.bar/examples/user-example.whatever'
+```
+
+A body parameter that is an array of string values:
+```json
+{
+ "description": "user to add to the system",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+required: true
+content:
+ text/plain:
+ schema:
+ type: array
+ items:
+ type: string
+```
+
+
+#### Media Type Object
+Each Media Type Object provides schema and examples for the media type identified by its key.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the content of the request, response, or parameter.
+example | Any | Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+encoding | Map[`string`, [Encoding Object](#encoding-object)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Media Type Examples
+
+```json
+{
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ },
+ "examples": {
+ "cat" : {
+ "summary": "An example of a cat",
+ "value":
+ {
+ "name": "Fluffy",
+ "petType": "Cat",
+ "color": "White",
+ "gender": "male",
+ "breed": "Persian"
+ }
+ },
+ "dog": {
+ "summary": "An example of a dog with a cat's name",
+ "value" : {
+ "name": "Puma",
+ "petType": "Dog",
+ "color": "Black",
+ "gender": "Female",
+ "breed": "Mixed"
+ },
+ "frog": {
+ "$ref": "#/components/examples/frog-example"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ examples:
+ cat:
+ summary: An example of a cat
+ value:
+ name: Fluffy
+ petType: Cat
+ color: White
+ gender: male
+ breed: Persian
+ dog:
+ summary: An example of a dog with a cat's name
+ value:
+ name: Puma
+ petType: Dog
+ color: Black
+ gender: Female
+ breed: Mixed
+ frog:
+ $ref: "#/components/examples/frog-example"
+```
+
+##### Considerations for File Uploads
+
+In contrast with the 2.0 specification, `file` input/output content in OpenAPI is described with the same semantics as any other schema type. Specifically:
+
+```yaml
+# content transferred with base64 encoding
+schema:
+ type: string
+ format: base64
+```
+
+```yaml
+# content transferred in binary (octet-stream):
+schema:
+ type: string
+ format: binary
+```
+
+These examples apply to either input payloads of file uploads or response payloads.
+
+A `requestBody` for submitting a file in a `POST` operation may look like the following example:
+
+```yaml
+requestBody:
+ content:
+ application/octet-stream:
+ # any media type is accepted, functionally equivalent to `*/*`
+ schema:
+ # a binary file of any type
+ type: string
+ format: binary
+```
+
+In addition, specific media types MAY be specified:
+
+```yaml
+# multiple, specific media types may be specified:
+requestBody:
+ content:
+ # a binary file of type png or jpeg
+ 'image/jpeg':
+ schema:
+ type: string
+ format: binary
+ 'image/png':
+ schema:
+ type: string
+ format: binary
+```
+
+To upload multiple files, a `multipart` media type MUST be used:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ # The property name 'file' will be used for all files.
+ file:
+ type: array
+ items:
+ type: string
+ format: binary
+
+```
+
+##### Support for x-www-form-urlencoded Request Bodies
+
+To submit content using form url encoding via [RFC1866](https://tools.ietf.org/html/rfc1866), the following
+definition may be used:
+
+```yaml
+requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # complex types are stringified to support RFC 1866
+ type: object
+ properties: {}
+```
+
+In this example, the contents in the `requestBody` MUST be stringified per [RFC1866](https://tools.ietf.org/html/rfc1866/) when passed to the server. In addition, the `address` field complex object will be stringified.
+
+When passing complex objects in the `application/x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the [`Encoding Object`](#encoding-object)'s [`style`](#encodingStyle) property as `form`.
+
+##### Special Considerations for `multipart` Content
+
+It is common to use `multipart/form-data` as a `Content-Type` when transferring request bodies to operations. In contrast to 2.0, a `schema` is REQUIRED to define the input parameters to the operation when using `multipart` content. This supports complex structures as well as supporting mechanisms for multiple file uploads.
+
+When passing in `multipart` types, boundaries MAY be used to separate sections of the content being transferred — thus, the following default `Content-Type`s are defined for `multipart`:
+
+* If the property is a primitive, or an array of primitive values, the default Content-Type is `text/plain`
+* If the property is complex, or an array of complex values, the default Content-Type is `application/json`
+* If the property is a `type: string` with `format: binary` or `format: base64` (aka a file object), the default Content-Type is `application/octet-stream`
+
+
+Examples:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # default Content-Type for objects is `application/json`
+ type: object
+ properties: {}
+ profileImage:
+ # default Content-Type for string/binary is `application/octet-stream`
+ type: string
+ format: binary
+ children:
+ # default Content-Type for arrays is based on the `inner` type (text/plain here)
+ type: array
+ items:
+ type: string
+ addresses:
+ # default Content-Type for arrays is based on the `inner` type (object shown, so `application/json` in this example)
+ type: array
+ items:
+ type: '#/components/schemas/Address'
+```
+
+An `encoding` attribute is introduced to give you control over the serialization of parts of `multipart` request bodies. This attribute is _only_ applicable to `multipart` and `application/x-www-form-urlencoded` request bodies.
+
+#### Encoding Object
+
+A single encoding definition applied to a single schema property.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+contentType | `string` | The Content-Type for encoding a specific property. Default value depends on the property type: for `string` with `format` being `binary` – `application/octet-stream`; for other primitive types – `text/plain`; for `object` - `application/json`; for `array` – the default is defined based on the inner type. The value can be a specific media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`), or a comma-separated list of the two types.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | A map allowing additional information to be provided as headers, for example `Content-Disposition`. `Content-Type` is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a `multipart`.
+style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameter-object) for details on the [`style`](#parameterStyle) property. The behavior follows the same values as `query` parameters, including default values. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+explode | `boolean` | When this is true, property values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When [`style`](#encodingStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Encoding Object Example
+
+```yaml
+requestBody:
+ content:
+ multipart/mixed:
+ schema:
+ type: object
+ properties:
+ id:
+ # default is text/plain
+ type: string
+ format: uuid
+ address:
+ # default is application/json
+ type: object
+ properties: {}
+ historyMetadata:
+ # need to declare XML format!
+ description: metadata in XML format
+ type: object
+ properties: {}
+ profileImage:
+ # default is application/octet-stream, need to declare an image type only!
+ type: string
+ format: binary
+ encoding:
+ historyMetadata:
+ # require XML Content-Type in utf-8 encoding
+ contentType: application/xml; charset=utf-8
+ profileImage:
+ # only accept png/jpeg
+ contentType: image/png, image/jpeg
+ headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+```
+
+#### Responses Object
+
+A container for the expected responses of an operation.
+The container maps a HTTP response code to the expected response.
+
+The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance.
+However, documentation is expected to cover a successful operation response and any known errors.
+
+The `default` MAY be used as a default response object for all HTTP codes
+that are not covered individually by the specification.
+
+The `Responses Object` MUST contain at least one response code, and it
+SHOULD be the response for a successful operation call.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+default | [Response Object](#response-object) \| [Reference Object](#reference-object) | The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. A [Reference Object](#reference-object) can link to a response that the [OpenAPI Object's components/responses](#componentsResponses) section defines.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+[HTTP Status Code](#http-status-codes) | [Response Object](#response-object) \| [Reference Object](#reference-object) | Any [HTTP status code](#http-status-codes) can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. A [Reference Object](#reference-object) can link to a response that is defined in the [OpenAPI Object's components/responses](#componentsResponses) section. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Responses Object Example
+
+A 200 response for a successful operation and a default response for others (implying an error):
+
+```json
+{
+ "200": {
+ "description": "a pet to be returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "Unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+'200':
+ description: a pet to be returned
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+```
+
+#### Response Object
+Describes a single response from an API Operation, including design-time, static
+`links` to operations based on the response.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | **REQUIRED**. A short description of the response. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | Maps a header name to its definition. [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing descriptions of potential response payloads. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for [Component Objects](#components-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Response Object Examples
+
+Response of an array of a complex type:
+
+```json
+{
+ "description": "A complex object array response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/VeryComplexType"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A complex object array response
+content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/VeryComplexType'
+```
+
+Response with a string type:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+```
+
+Plain text response with headers:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ },
+ "headers": {
+ "X-Rate-Limit-Limit": {
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Remaining": {
+ "description": "The number of remaining requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Reset": {
+ "description": "The number of seconds left in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+ example: 'whoa!'
+headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Remaining:
+ description: The number of remaining requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Reset:
+ description: The number of seconds left in the current period
+ schema:
+ type: integer
+```
+
+Response with no return value:
+
+```json
+{
+ "description": "object created"
+}
+```
+
+```yaml
+description: object created
+```
+
+#### Callback Object
+
+A map of possible out-of band callbacks related to the parent operation.
+Each value in the map is a [Path Item Object](#path-item-object) that describes a set of requests that may be initiated by the API provider and the expected responses.
+The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+{expression} | [Path Item Object](#path-item-object) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Key Expression
+
+The key that identifies the [Path Item Object](#path-item-object) is a [runtime expression](#runtime-expressions) that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.
+A simple example might be `$request.body#/url`.
+However, using a [runtime expression](#runtime-expressions) the complete HTTP message can be accessed.
+This includes accessing any part of a body that a JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) can reference.
+
+For example, given the following HTTP request:
+
+```http
+POST /subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning HTTP/1.1
+Host: example.org
+Content-Type: application/json
+Content-Length: 187
+
+{
+ "failedUrl" : "http://clientdomain.com/failed",
+ "successUrls" : [
+ "http://clientdomain.com/fast",
+ "http://clientdomain.com/medium",
+ "http://clientdomain.com/slow"
+ ]
+}
+
+201 Created
+Location: http://example.org/subscription/1
+```
+
+The following examples show how the various expressions evaluate, assuming the callback operation has a path parameter named `eventType` and a query parameter named `queryUrl`.
+
+Expression | Value
+---|:---
+$url | http://example.org/subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning
+$method | POST
+$request.path.eventType | myevent
+$request.query.queryUrl | http://clientdomain.com/stillrunning
+$request.header.content-Type | application/json
+$request.body#/failedUrl | http://clientdomain.com/failed
+$request.body#/successUrls/2 | http://clientdomain.com/medium
+$response.header.Location | http://example.org/subscription/1
+
+
+##### Callback Object Example
+
+The following example shows a callback to the URL specified by the `id` and `email` property in the request body.
+
+```yaml
+myWebhook:
+ 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: webhook successfully processed and no retries will be performed
+```
+
+
+#### Example Object
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+summary | `string` | Short description for the example.
+description | `string` | Long description for the example. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+value | Any | Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
+externalValue | `string` | A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `externalValue` field are mutually exclusive.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+In all cases, the example value is expected to be compatible with the type schema
+of its associated value. Tooling implementations MAY choose to
+validate compatibility automatically, and reject the example value(s) if incompatible.
+
+##### Example Object Examples
+
+In a model:
+
+```yaml
+schemas:
+ properties:
+ name:
+ type: string
+ examples:
+ name:
+ $ref: http://example.org/petapi-examples/openapi.json#/components/examples/name-example
+```
+
+In a request body:
+
+```yaml
+requestBody:
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Address'
+ examples:
+ foo:
+ summary: A foo example
+ value: {"foo": "bar"}
+ bar:
+ summary: A bar example
+ value: {"bar": "baz"}
+ 'application/xml':
+ examples:
+ xmlExample:
+ summary: This is an example in XML
+ externalValue: 'http://example.org/examples/address-example.xml'
+ 'text/plain':
+ examples:
+ textExample:
+ summary: This is a text example
+ externalValue: 'http://foo.bar/examples/address-example.txt'
+```
+
+In a parameter:
+
+```yaml
+parameters:
+ - name: 'zipCode'
+ in: 'query'
+ schema:
+ type: 'string'
+ format: 'zip-code'
+ examples:
+ zip-example:
+ $ref: '#/components/examples/zip-example'
+```
+
+In a response:
+
+```yaml
+responses:
+ '200':
+ description: your car appointment has been booked
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SuccessResponse'
+ examples:
+ confirmation-success:
+ $ref: '#/components/examples/confirmation-success'
+```
+
+
+#### Link Object
+
+The `Link object` represents a possible design-time link for a response.
+The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
+
+Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response.
+
+For computing links, and providing instructions to execute them, a [runtime expression](#runtime-expressions) is used for accessing values in an operation and using them as parameters while invoking the linked operation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+operationRef | `string` | A relative or absolute reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an [Operation Object](#operation-object). Relative `operationRef` values MAY be used to locate an existing [Operation Object](#operation-object) in the OpenAPI definition.
+operationId | `string` | The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
+parameters | Map[`string`, Any \| [{expression}](#runtime-expressions)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path.id).
+requestBody | Any \| [{expression}](#runtime-expressions) | A literal value or [{expression}](#runtime-expressions) to use as a request body when calling the target operation.
+description | `string` | A description of the link. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+server | [Server Object](#server-object) | A server object to be used by the target operation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+A linked operation MUST be identified using either an `operationRef` or `operationId`.
+In the case of an `operationId`, it MUST be unique and resolved in the scope of the OAS document.
+Because of the potential for name clashes, the `operationRef` syntax is preferred
+for specifications with external references.
+
+##### Examples
+
+Computing a link from a request operation where the `$request.path.id` is used to pass a request parameter to the linked operation.
+
+```yaml
+paths:
+ /users/{id}:
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ get:
+ responses:
+ '200':
+ description: the user being returned
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ uuid: # the unique user id
+ type: string
+ format: uuid
+ links:
+ address:
+ # the target link operationId
+ operationId: getUserAddress
+ parameters:
+ # get the `id` field from the request path parameter named `id`
+ userId: $request.path.id
+ # the path item of the linked operation
+ /users/{userid}/address:
+ parameters:
+ - name: userid
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ # linked operation
+ get:
+ operationId: getUserAddress
+ responses:
+ '200':
+ description: the user's address
+```
+
+When a runtime expression fails to evaluate, no parameter value is passed to the target operation.
+
+Values from the response body can be used to drive a linked operation.
+
+```yaml
+links:
+ address:
+ operationId: getUserAddressByUUID
+ parameters:
+ # get the `uuid` field from the `uuid` field in the response body
+ userUuid: $response.body#/uuid
+```
+
+Clients follow all links at their discretion.
+Neither permissions, nor the capability to make a successful call to that link, is guaranteed
+solely by the existence of a relationship.
+
+
+##### OperationRef Examples
+
+As references to `operationId` MAY NOT be possible (the `operationId` is an optional
+value), references MAY also be made through a relative `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: '#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+or an absolute `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
+using JSON references.
+
+
+##### Runtime Expressions
+
+Runtime expressions allow defining values based on information that will only be available within the HTTP message in an actual API call.
+This mechanism is used by [Link Objects](#link-object) and [Callback Objects](#callback-object).
+
+The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
+
+```
+ expression = ( "$url" | "$method" | "$statusCode" | "$request." source | "$response." source )
+ source = ( header-reference | query-reference | path-reference | body-reference )
+ header-reference = "header." token
+ query-reference = "query." name
+ path-reference = "path." name
+ body-reference = "body" ["#" fragment]
+ fragment = a JSON Pointer [RFC 6901](https://tools.ietf.org/html/rfc6901)
+ name = *( char )
+ char = as per RFC [7159](https://tools.ietf.org/html/rfc7159#section-7)
+ token = as per RFC [7230](https://tools.ietf.org/html/rfc7230#section-3.2.6)
+```
+
+The `name` identifier is case-sensitive, whereas `token` is not.
+
+The table below provides examples of runtime expressions and examples of their use in a value:
+
+##### Examples
+
+Source Location | example expression | notes
+---|:---|:---|
+HTTP Method | `$method` | The allowable values for the `$method` will be those for the HTTP operation.
+Requested media type | `$request.header.accept` |
+Request parameter | `$request.path.id` | Request parameters MUST be declared in the `parameters` section of the parent operation or they cannot be evaluated. This includes request headers.
+Request body property | `$request.body#/user/uuid` | In operations which accept payloads, references may be made to portions of the `requestBody` or the entire body.
+Request URL | `$url` |
+Response value | `$response.body#/status` | In operations which return payloads, references may be made to portions of the response body or the entire body.
+Response header | `$response.header.Server` | Single header values only are available
+
+Runtime expressions preserve the type of the referenced value.
+Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
+
+#### Header Object
+
+The Header Object follows the structure of the [Parameter Object](#parameter-object) with the following changes:
+
+1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
+1. `in` MUST NOT be specified, it is implicitly in `header`.
+1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, [`style`](#parameterStyle)).
+
+##### Header Object Example
+
+A simple header of type `integer`:
+
+```json
+{
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+}
+```
+
+```yaml
+description: The number of allowed requests in the current period
+schema:
+ type: integer
+```
+
+#### Tag Object
+
+Adds metadata to a single tag that is used by the [Operation Object](#operation-object).
+It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the tag.
+description | `string` | A short description for the tag. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this tag.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Tag Object Example
+
+```json
+{
+ "name": "pet",
+ "description": "Pets operations"
+}
+```
+
+```yaml
+name: pet
+description: Pets operations
+```
+
+
+#### Reference Object
+
+A simple object to allow referencing other components in the specification, internally and externally.
+
+The Reference Object is defined by [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) and follows the same structure, behavior and rules.
+
+For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | **REQUIRED**. The reference string.
+
+This object cannot be extended with additional properties and any properties added SHALL be ignored.
+
+##### Reference Object Example
+
+```json
+{
+ "$ref": "#/components/schemas/Pet"
+}
+```
+
+```yaml
+$ref: '#/components/schemas/Pet'
+```
+
+##### Relative Schema Document Example
+```json
+{
+ "$ref": "Pet.json"
+}
+```
+
+```yaml
+$ref: Pet.yaml
+```
+
+##### Relative Documents With Embedded Schema Example
+```json
+{
+ "$ref": "definitions.json#/Pet"
+}
+```
+
+```yaml
+$ref: definitions.yaml#/Pet
+```
+
+#### Schema Object
+
+The Schema Object allows the definition of input and output data types.
+These types can be objects, but also primitives and arrays.
+This object is an extended subset of the [JSON Schema Specification Wright Draft 00](http://json-schema.org/).
+
+For more information about the properties, see [JSON Schema Core](https://tools.ietf.org/html/draft-wright-json-schema-00) and [JSON Schema Validation](https://tools.ietf.org/html/draft-wright-json-schema-validation-00).
+Unless stated otherwise, the property definitions follow the JSON Schema.
+
+##### Properties
+
+The following properties are taken directly from the JSON Schema definition and follow the same specifications:
+
+- title
+- multipleOf
+- maximum
+- exclusiveMaximum
+- minimum
+- exclusiveMinimum
+- maxLength
+- minLength
+- pattern (This string SHOULD be a valid regular expression, according to the [ECMA 262 regular expression](https://www.ecma-international.org/ecma-262/5.1/#sec-7.8.5) dialect)
+- maxItems
+- minItems
+- uniqueItems
+- maxProperties
+- minProperties
+- required
+- enum
+
+The following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
+- type - Value MUST be a string. Multiple types via an array are not supported.
+- allOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- oneOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- anyOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- not - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- items - Value MUST be an object and not an array. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema. `items` MUST be present if the `type` is `array`.
+- properties - Property definitions MUST be a [Schema Object](#schema-object) and not a standard JSON Schema (inline or referenced).
+- additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema. Consistent with JSON Schema, `additionalProperties` defaults to `true`.
+- description - [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+- format - See [Data Type Formats](#dataTypeFormat) for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
+- default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if `type` is `string`, then `default` can be `"foo"` but cannot be `1`.
+
+Alternatively, any time a Schema Object can be used, a [Reference Object](#reference-object) can be used in its place. This allows referencing definitions instead of defining them inline.
+
+Additional properties defined by the JSON Schema specification that are not mentioned here are strictly unsupported.
+
+Other than the JSON Schema subset fields, the following fields MAY be used for further schema documentation:
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+nullable | `boolean` | Allows sending a `null` value for the defined schema. Default value is `false`.
+discriminator | [Discriminator Object](#discriminator-object) | Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](#composition-and-inheritance-polymorphism) for more details.
+readOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as `readOnly` being `true` and is in the `required` list, the `required` will take effect on the response only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
+writeOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "write only". Therefore, it MAY be sent as part of a request but SHOULD NOT be sent as part of the response. If the property is marked as `writeOnly` being `true` and is in the `required` list, the `required` will take effect on the request only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
+xml | [XML Object](#xml-object) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this schema.
+example | Any | A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
+ deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+###### Composition and Inheritance (Polymorphism)
+
+The OpenAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition.
+`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
+
+While composition offers model extensibility, it does not imply a hierarchy between the models.
+To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
+When used, the `discriminator` will be the name of the property that decides which schema definition validates the structure of the model.
+As such, the `discriminator` field MUST be a required field.
+There are two ways to define the value of a discriminator for an inheriting instance.
+- Use the schema name.
+- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
+As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.
+
+###### XML Modeling
+
+The [xml](#schemaXml) property allows extra definitions when translating the JSON definition to XML.
+The [XML Object](#xml-object) contains additional information about the available options.
+
+##### Schema Object Examples
+
+###### Primitive Sample
+
+```json
+{
+ "type": "string",
+ "format": "email"
+}
+```
+
+```yaml
+type: string
+format: email
+```
+
+###### Simple Model
+
+```json
+{
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "address": {
+ "$ref": "#/components/schemas/Address"
+ },
+ "age": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ }
+ }
+}
+```
+
+```yaml
+type: object
+required:
+- name
+properties:
+ name:
+ type: string
+ address:
+ $ref: '#/components/schemas/Address'
+ age:
+ type: integer
+ format: int32
+ minimum: 0
+```
+
+###### Model with Map/Dictionary Properties
+
+For a simple string to string mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ type: string
+```
+
+For a string to model mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/ComplexModel"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ $ref: '#/components/schemas/ComplexModel'
+```
+
+###### Model with Example
+
+```json
+{
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "example": {
+ "name": "Puma",
+ "id": 1
+ }
+}
+```
+
+```yaml
+type: object
+properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+required:
+- name
+example:
+ name: Puma
+ id: 1
+```
+
+###### Models with Composition
+
+```json
+{
+ "components": {
+ "schemas": {
+ "ErrorModel": {
+ "type": "object",
+ "required": [
+ "message",
+ "code"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 600
+ }
+ }
+ },
+ "ExtendedErrorModel": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ErrorModel"
+ },
+ {
+ "type": "object",
+ "required": [
+ "rootCause"
+ ],
+ "properties": {
+ "rootCause": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ ErrorModel:
+ type: object
+ required:
+ - message
+ - code
+ properties:
+ message:
+ type: string
+ code:
+ type: integer
+ minimum: 100
+ maximum: 600
+ ExtendedErrorModel:
+ allOf:
+ - $ref: '#/components/schemas/ErrorModel'
+ - type: object
+ required:
+ - rootCause
+ properties:
+ rootCause:
+ type: string
+```
+
+###### Models with Polymorphism Support
+
+```json
+{
+ "components": {
+ "schemas": {
+ "Pet": {
+ "type": "object",
+ "discriminator": {
+ "propertyName": "petType"
+ },
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "petType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "petType"
+ ]
+ },
+ "Cat": {
+ "description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "huntingSkill": {
+ "type": "string",
+ "description": "The measured skill for hunting",
+ "default": "lazy",
+ "enum": [
+ "clueless",
+ "lazy",
+ "adventurous",
+ "aggressive"
+ ]
+ }
+ },
+ "required": [
+ "huntingSkill"
+ ]
+ }
+ ]
+ },
+ "Dog": {
+ "description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "packSize": {
+ "type": "integer",
+ "format": "int32",
+ "description": "the size of the pack the dog is from",
+ "default": 0,
+ "minimum": 0
+ }
+ },
+ "required": [
+ "packSize"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ discriminator:
+ propertyName: petType
+ properties:
+ name:
+ type: string
+ petType:
+ type: string
+ required:
+ - name
+ - petType
+ Cat: ## "Cat" will be used as the discriminator value
+ description: A representation of a cat
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ huntingSkill:
+ type: string
+ description: The measured skill for hunting
+ enum:
+ - clueless
+ - lazy
+ - adventurous
+ - aggressive
+ required:
+ - huntingSkill
+ Dog: ## "Dog" will be used as the discriminator value
+ description: A representation of a dog
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ packSize:
+ type: integer
+ format: int32
+ description: the size of the pack the dog is from
+ default: 0
+ minimum: 0
+ required:
+ - packSize
+```
+
+#### Discriminator Object
+
+When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
+
+When using the discriminator, _inline_ schemas will not be considered.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value.
+ mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or references.
+
+The discriminator object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`.
+
+In OAS 3.0, a response payload MAY be described to be exactly one of any number of types:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+```
+
+which means the payload _MUST_, by validation, match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. In this case, a discriminator MAY act as a "hint" to shortcut validation and selection of the matching schema which may be a costly operation, depending on the complexity of the schema. We can then describe exactly which field tells us which schema to use:
+
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ discriminator:
+ propertyName: petType
+```
+
+The expectation now is that a property with name `petType` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OAS document. Thus the response payload:
+
+```json
+{
+ "id": 12345,
+ "petType": "Cat"
+}
+```
+
+Will indicate that the `Cat` schema be used in conjunction with this payload.
+
+In scenarios where the value of the discriminator field does not match the schema name or implicit mapping is not possible, an optional `mapping` definition MAY be used:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ - $ref: 'https://gigantic-server.com/schemas/Monster/schema.json'
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: '#/components/schemas/Dog'
+ monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
+```
+
+Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Mapping keys MUST be string values, but tooling MAY convert response values to strings for comparison.
+
+When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
+
+In both the `oneOf` and `anyOf` use cases, all possible schemas MUST be listed explicitly. To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas comprising the parent schema in an `allOf` construct may be used as an alternate schema.
+
+For example:
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ required:
+ - petType
+ properties:
+ petType:
+ type: string
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: Dog
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Cat`
+ properties:
+ name:
+ type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Dog`
+ properties:
+ bark:
+ type: string
+ Lizard:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Lizard`
+ properties:
+ lovesRocks:
+ type: boolean
+```
+
+a payload like this:
+
+```json
+{
+ "petType": "Cat",
+ "name": "misty"
+}
+```
+
+will indicate that the `Cat` schema be used. Likewise this schema:
+
+```json
+{
+ "petType": "dog",
+ "bark": "soft"
+}
+```
+
+will map to `Dog` because of the definition in the `mappings` element.
+
+
+#### XML Object
+
+A metadata object that allows for more fine-tuned XML model definitions.
+
+When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information.
+See examples for expected behavior.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `array` (outside the `items`), it will affect the wrapping element and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored.
+namespace | `string` | The URI of the namespace definition. Value MUST be in the form of an absolute URI.
+prefix | `string` | The prefix to be used for the [name](#xmlName).
+attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
+wrapped | `boolean` | MAY be used only for an array definition. Signifies whether the array is wrapped (for example, ``) or unwrapped (``). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### XML Object Examples
+
+The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schema-object) with a sample of the XML representation of it.
+
+###### No XML Element
+
+Basic string property:
+
+```json
+{
+ "animals": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+```
+
+```xml
+...
+```
+
+Basic string array property ([`wrapped`](#xmlWrapped) is `false` by default):
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+```
+
+```xml
+...
+...
+...
+```
+
+###### XML Name Replacement
+
+```json
+{
+ "animals": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+...
+```
+
+
+###### XML Attribute, Prefix and Namespace
+
+In this example, a full model definition is shown.
+
+```json
+{
+ "Person": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "xml": {
+ "attribute": true
+ }
+ },
+ "name": {
+ "type": "string",
+ "xml": {
+ "namespace": "http://example.com/schema/sample",
+ "prefix": "sample"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+Person:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int32
+ xml:
+ attribute: true
+ name:
+ type: string
+ xml:
+ namespace: http://example.com/schema/sample
+ prefix: sample
+```
+
+```xml
+
+ example
+
+```
+
+###### XML Arrays
+
+Changing the element names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+value
+value
+```
+
+The external `name` property has no effect on the XML:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+```
+
+```xml
+value
+value
+```
+
+Even when the array is wrapped, if a name is not explicitly defined, the same name will be used both internally and externally:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+To overcome the naming problem in the example above, the following definition can be used:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+Affecting both internal and external names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+If we change the external element but not the internal ones:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+#### Security Scheme Object
+
+Defines a security scheme that can be used by the operations.
+Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in [RFC6749](https://tools.ietf.org/html/rfc6749), and [OpenID Connect Discovery](https://tools.ietf.org/html/draft-ietf-oauth-discovery-06).
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+type | `string` | Any | **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
+description | `string` | Any | A short description for security scheme. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+name | `string` | `apiKey` | **REQUIRED**. The name of the header, query or cookie parameter to be used.
+in | `string` | `apiKey` | **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"` or `"cookie"`.
+scheme | `string` | `http` | **REQUIRED**. The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-5.1).
+bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
+flows | [OAuth Flows Object](#oauth-flows-object) | `oauth2` | **REQUIRED**. An object containing configuration information for the flow types supported.
+openIdConnectUrl | `string` | `openIdConnect` | **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Security Scheme Object Example
+
+###### Basic Authentication Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "basic"
+}
+```
+
+```yaml
+type: http
+scheme: basic
+```
+
+###### API Key Sample
+
+```json
+{
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+}
+```
+
+```yaml
+type: apiKey
+name: api_key
+in: header
+```
+
+###### JWT Bearer Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "bearer",
+ "bearerFormat": "JWT",
+}
+```
+
+```yaml
+type: http
+scheme: bearer
+bearerFormat: JWT
+```
+
+###### Implicit OAuth2 Sample
+
+```json
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```yaml
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+#### OAuth Flows Object
+
+Allows configuration of the supported OAuth Flows.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+implicit| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Implicit flow
+password| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Resource Owner Password flow
+clientCredentials| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
+authorizationCode| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### OAuth Flow Object
+
+Configuration details for a supported OAuth Flow
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL.
+tokenUrl | `string` | `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`) | **REQUIRED**. The token URL to be used for this flow. This MUST be in the form of a URL.
+refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
+scopes | Map[`string`, `string`] | `oauth2` | **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### OAuth Flow Object Examples
+
+```JSON
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ },
+ "authorizationCode": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "tokenUrl": "https://example.com/api/oauth/token",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```yaml
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ authorizationCode:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+
+#### Security Requirement Object
+
+Lists the required security schemes to execute this operation.
+The name used for each property MUST correspond to a security scheme declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object).
+
+Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized.
+This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
+
+When a list of Security Requirement Objects is defined on the [OpenAPI Object](#openapi-object) or [Operation Object](#operation-object), only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.
+
+##### Security Requirement Object Examples
+
+###### Non-OAuth2 Security Requirement
+
+```json
+{
+ "api_key": []
+}
+```
+
+```yaml
+api_key: []
+```
+
+###### OAuth2 Security Requirement
+
+```json
+{
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+}
+```
+
+```yaml
+petstore_auth:
+- write:pets
+- read:pets
+```
+
+### Specification Extensions
+
+While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
+
+The extensions properties are implemented as patterned fields that are always prefixed by `"x-"`.
+
+Field Pattern | Type | Description
+---|:---:|---
+^x- | Any | Allows extensions to the OpenAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. Can have any valid JSON format value.
+
+The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).
+
+### Security Filtering
+
+Some objects in the OpenAPI Specification MAY be declared and remain empty, or be completely removed, even though they are inherently the core of the API documentation.
+
+The reasoning is to allow an additional layer of access control over the documentation.
+While not part of the specification itself, certain libraries MAY choose to allow access to parts of the documentation based on some form of authentication/authorization.
+
+Two examples of this:
+
+1. The [Paths Object](#paths-object) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#info-object) which may contain additional information regarding authentication.
+2. The [Path Item Object](#path-item-object) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different than hiding the path itself from the [Paths Object](#paths-object), so the user will not be aware of its existence. This allows the documentation provider to finely control what the viewer can see.
+
+## Appendix A: Revision History
+
+Version | Date | Notes
+--- | --- | ---
+3.0.2 | 2018-10-08 | Patch release of the OpenAPI Specification 3.0.2
+3.0.1 | 2017-12-06 | Patch release of the OpenAPI Specification 3.0.1
+3.0.0 | 2017-07-26 | Release of the OpenAPI Specification 3.0.0
+3.0.0-rc2 | 2017-06-16 | rc2 of the 3.0 specification
+3.0.0-rc1 | 2017-04-27 | rc1 of the 3.0 specification
+3.0.0-rc0 | 2017-02-28 | Implementer's Draft of the 3.0 specification
+2.0 | 2015-12-31 | Donation of Swagger 2.0 to the Open API Initiative
+2.0 | 2014-09-08 | Release of Swagger 2.0
+1.2 | 2014-03-14 | Initial release of the formal document.
+1.1 | 2012-08-22 | Release of Swagger 1.1
+1.0 | 2011-08-10 | First release of the Swagger Specification
diff --git a/versions/3.0.3.md b/versions/3.0.3.md
new file mode 100644
index 0000000000..13a96ea657
--- /dev/null
+++ b/versions/3.0.3.md
@@ -0,0 +1,3454 @@
+# OpenAPI Specification
+
+#### Version 3.0.3
+
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
+
+This document is licensed under [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).
+
+## Introduction
+
+The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.
+
+An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
+
+## Table of Contents
+
+
+- [Definitions](#definitions)
+ - [OpenAPI Document](#openapi-document)
+ - [Path Templating](#path-templating)
+ - [Media Types](#media-types)
+ - [HTTP Status Codes](#http-status-codes)
+- [Specification](#specification)
+ - [Versions](#versions)
+ - [Format](#format)
+ - [Document Structure](#document-structure)
+ - [Data Types](#data-types)
+ - [Rich Text Formatting](#rich-text-formatting)
+ - [Relative References In URLs](#relative-references-in-urls)
+ - [Schema](#schema)
+ - [OpenAPI Object](#openapi-object)
+ - [Info Object](#info-object)
+ - [Contact Object](#contact-object)
+ - [License Object](#license-object)
+ - [Server Object](#server-object)
+ - [Server Variable Object](#server-variable-object)
+ - [Components Object](#components-object)
+ - [Paths Object](#paths-object)
+ - [Path Item Object](#path-item-object)
+ - [Operation Object](#operation-object)
+ - [External Documentation Object](#external-documentation-object)
+ - [Parameter Object](#parameter-object)
+ - [Request Body Object](#request-body-object)
+ - [Media Type Object](#media-type-object)
+ - [Encoding Object](#encoding-object)
+ - [Responses Object](#responses-object)
+ - [Response Object](#response-object)
+ - [Callback Object](#callback-object)
+ - [Example Object](#example-object)
+ - [Link Object](#link-object)
+ - [Header Object](#header-object)
+ - [Tag Object](#tag-object)
+ - [Reference Object](#reference-object)
+ - [Schema Object](#schema-object)
+ - [Discriminator Object](#discriminator-object)
+ - [XML Object](#xml-object)
+ - [Security Scheme Object](#security-scheme-object)
+ - [OAuth Flows Object](#oauth-flows-object)
+ - [OAuth Flow Object](#oauth-flow-object)
+ - [Security Requirement Object](#security-requirement-object)
+ - [Specification Extensions](#specification-extensions)
+ - [Security Filtering](#security-filtering)
+- [Appendix A: Revision History](#appendix-a-revision-history)
+
+
+
+
+## Definitions
+
+##### OpenAPI Document
+A document (or set of documents) that defines or describes an API. An OpenAPI definition uses and conforms to the OpenAPI Specification.
+
+##### Path Templating
+Path templating refers to the usage of template expressions, delimited by curly braces ({}), to mark a section of a URL path as replaceable using path parameters.
+
+Each template expression in the path MUST correspond to a path parameter that is included in the [Path Item](#path-item-object) itself and/or in each of the Path Item's [Operations](#operation-object).
+
+##### Media Types
+Media type definitions are spread across several resources.
+The media type definitions SHOULD be in compliance with [RFC6838](https://tools.ietf.org/html/rfc6838).
+
+Some examples of possible media type definitions:
+```
+ text/plain; charset=utf-8
+ application/json
+ application/vnd.github+json
+ application/vnd.github.v3+json
+ application/vnd.github.v3.raw+json
+ application/vnd.github.v3.text+json
+ application/vnd.github.v3.html+json
+ application/vnd.github.v3.full+json
+ application/vnd.github.v3.diff
+ application/vnd.github.v3.patch
+```
+##### HTTP Status Codes
+The HTTP Status Codes are used to indicate the status of the executed operation.
+The available status codes are defined by [RFC7231](https://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
+
+## Specification
+
+### Versions
+
+The OpenAPI Specification is versioned using [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) (semver) and follows the semver specification.
+
+The `major`.`minor` portion of the semver (for example `3.0`) SHALL designate the OAS feature set. Typically, *`.patch`* versions address errors in this document, not the feature set. Tooling which supports OAS 3.0 SHOULD be compatible with all OAS 3.0.\* versions. The patch version SHOULD NOT be considered by tooling, making no distinction between `3.0.0` and `3.0.1` for example.
+
+Each new minor version of the OpenAPI Specification SHALL allow any OpenAPI document that is valid against any previous minor version of the Specification, within the same major version, to be updated to the new Specification version with equivalent semantics. Such an update MUST only require changing the `openapi` property to the new minor version.
+
+For example, a valid OpenAPI 3.0.2 document, upon changing its `openapi` property to `3.1.0`, SHALL be a valid OpenAPI 3.1.0 document, semantically equivalent to the original OpenAPI 3.0.2 document. New minor versions of the OpenAPI Specification MUST be written to ensure this form of backward compatibility.
+
+An OpenAPI document compatible with OAS 3.\*.\* contains a required [`openapi`](#oasVersion) field which designates the semantic version of the OAS that it uses. (OAS 2.0 documents contain a top-level version field named [`swagger`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swaggerObject) and value `"2.0"`.)
+
+### Format
+
+An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
+
+For example, if a field has an array value, the JSON array representation will be used:
+
+```json
+{
+ "field": [ 1, 2, 3 ]
+}
+```
+All field names in the specification are **case sensitive**.
+This includes all fields that are used as keys in a map, except where explicitly noted that keys are **case insensitive**.
+
+The schema exposes two types of fields: Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name.
+
+Patterned fields MUST have unique names within the containing object.
+
+In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](https://yaml.org/spec/1.2/spec.html) is RECOMMENDED along with some additional constraints:
+
+- Tags MUST be limited to those allowed by the [JSON Schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231).
+- Keys used in YAML maps MUST be limited to a scalar string, as defined by the [YAML Failsafe schema ruleset](https://yaml.org/spec/1.2/spec.html#id2802346).
+
+**Note:** While APIs may be defined by OpenAPI documents in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
+
+### Document Structure
+
+An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the user. In the latter case, `$ref` fields MUST be used in the specification to reference those parts as follows from the [JSON Schema](https://json-schema.org) definitions.
+
+It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `openapi.yaml`.
+
+### Data Types
+
+Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
+Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
+`null` is not supported as a type (see [`nullable`](#schemaNullable) for an alternative solution).
+Models are defined using the [Schema Object](#schema-object), which is an extended subset of JSON Schema Specification Wright Draft 00.
+
+Primitives have an optional modifier property: `format`.
+OAS uses several known formats to define in fine detail the data type being used.
+However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value.
+Formats such as `"email"`, `"uuid"`, and so on, MAY be used even though undefined by this specification.
+Types that are not accompanied by a `format` property follow the type definition in the JSON Schema. Tools that do not recognize a specific `format` MAY default back to the `type` alone, as if the `format` is not specified.
+
+The formats defined by the OAS are:
+
+[`type`](#data-types) | [`format`](#dataTypeFormat) | Comments
+------ | -------- | --------
+`integer` | `int32` | signed 32 bits
+`integer` | `int64` | signed 64 bits (a.k.a long)
+`number` | `float` | |
+`number` | `double` | |
+`string` | | |
+`string` | `byte` | base64 encoded characters
+`string` | `binary` | any sequence of octets
+`boolean` | | |
+`string` | `date` | As defined by `full-date` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
+`string` | `date-time` | As defined by `date-time` - [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
+`string` | `password` | A hint to UIs to obscure input.
+
+
+### Rich Text Formatting
+Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
+Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](https://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
+
+### Relative References in URLs
+
+Unless specified otherwise, all properties that are URLs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+Relative references are resolved using the URLs defined in the [`Server Object`](#server-object) as a Base URI.
+
+Relative references used in `$ref` are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), using the URL of the current document as the base URI. See also the [Reference Object](#reference-object).
+
+### Schema
+
+In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
+
+#### OpenAPI Object
+
+This is the root document object of the [OpenAPI document](#openapi-document).
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+openapi | `string` | **REQUIRED**. This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenAPI Specification version](#versions) that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is *not* related to the API [`info.version`](#infoVersion) string.
+info | [Info Object](#info-object) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
+servers | [[Server Object](#server-object)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#serverUrl) value of `/`.
+paths | [Paths Object](#paths-object) | **REQUIRED**. The available paths and operations for the API.
+components | [Components Object](#components-object) | An element to hold various schemas for the specification.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement (`{}`) can be included in the array.
+tags | [[Tag Object](#tag-object)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operation-object) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Info Object
+
+The object provides metadata about the API.
+The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+title | `string` | **REQUIRED**. The title of the API.
+description | `string` | A short description of the API. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
+contact | [Contact Object](#contact-object) | The contact information for the exposed API.
+license | [License Object](#license-object) | The license information for the exposed API.
+version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Info Object Example
+
+```json
+{
+ "title": "Sample Pet Store App",
+ "description": "This is a sample server for a pet store.",
+ "termsOfService": "http://example.com/terms/",
+ "contact": {
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+ },
+ "version": "1.0.1"
+}
+```
+
+```yaml
+title: Sample Pet Store App
+description: This is a sample server for a pet store.
+termsOfService: http://example.com/terms/
+contact:
+ name: API Support
+ url: http://www.example.com/support
+ email: support@example.com
+license:
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+version: 1.0.1
+```
+
+#### Contact Object
+
+Contact information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | The identifying name of the contact person/organization.
+url | `string` | The URL pointing to the contact information. MUST be in the format of a URL.
+email | `string` | The email address of the contact person/organization. MUST be in the format of an email address.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Contact Object Example
+
+```json
+{
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+}
+```
+
+```yaml
+name: API Support
+url: http://www.example.com/support
+email: support@example.com
+```
+
+#### License Object
+
+License information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The license name used for the API.
+url | `string` | A URL to the license used for the API. MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### License Object Example
+
+```json
+{
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+}
+```
+
+```yaml
+name: Apache 2.0
+url: https://www.apache.org/licenses/LICENSE-2.0.html
+```
+
+#### Server Object
+
+An object representing a Server.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
+description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+variables | Map[`string`, [Server Variable Object](#server-variable-object)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Server Object Example
+
+A single server would be described as:
+
+```json
+{
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+}
+```
+
+```yaml
+url: https://development.gigantic-server.com/v1
+description: Development server
+```
+
+The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+ },
+ {
+ "url": "https://staging.gigantic-server.com/v1",
+ "description": "Staging server"
+ },
+ {
+ "url": "https://api.gigantic-server.com/v1",
+ "description": "Production server"
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://development.gigantic-server.com/v1
+ description: Development server
+- url: https://staging.gigantic-server.com/v1
+ description: Staging server
+- url: https://api.gigantic-server.com/v1
+ description: Production server
+```
+
+The following shows how variables can be used for a server configuration:
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
+ "description": "The production API server",
+ "variables": {
+ "username": {
+ "default": "demo",
+ "description": "this value is assigned by the service provider, in this example `gigantic-server.com`"
+ },
+ "port": {
+ "enum": [
+ "8443",
+ "443"
+ ],
+ "default": "8443"
+ },
+ "basePath": {
+ "default": "v2"
+ }
+ }
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://{username}.gigantic-server.com:{port}/{basePath}
+ description: The production API server
+ variables:
+ username:
+ # note! no enum here means it is an open value
+ default: demo
+ description: this value is assigned by the service provider, in this example `gigantic-server.com`
+ port:
+ enum:
+ - '8443'
+ - '443'
+ default: '8443'
+ basePath:
+ # open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
+ default: v2
+```
+
+
+#### Server Variable Object
+
+An object representing a Server Variable for server URL template substitution.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+enum | [`string`] | An enumeration of string values to be used if the substitution options are from a limited set. The array SHOULD NOT be empty.
+default | `string` | **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. If the [`enum`](#serverVariableEnum) is defined, the value SHOULD exist in the enum's values.
+description | `string` | An optional description for the server variable. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Components Object
+
+Holds a set of reusable objects for different aspects of the OAS.
+All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
+
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---|---
+ schemas | Map[`string`, [Schema Object](#schema-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Schema Objects](#schema-object).
+ responses | Map[`string`, [Response Object](#response-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Response Objects](#response-object).
+ parameters | Map[`string`, [Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Parameter Objects](#parameter-object).
+ examples | Map[`string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Example Objects](#example-object).
+ requestBodies | Map[`string`, [Request Body Object](#request-body-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Request Body Objects](#request-body-object).
+ headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Header Objects](#header-object).
+ securitySchemes| Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object).
+ links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Link Objects](#link-object).
+ callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Callback Objects](#callback-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`.
+
+Field Name Examples:
+
+```
+User
+User_1
+User_Name
+user-name
+my.org.User
+```
+
+##### Components Object Example
+
+```json
+"components": {
+ "schemas": {
+ "GeneralError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "Category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "Tag": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "skipParam": {
+ "name": "skip",
+ "in": "query",
+ "description": "number of items to skip",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "limitParam": {
+ "name": "limit",
+ "in": "query",
+ "description": "max records to return",
+ "required": true,
+ "schema" : {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ },
+ "responses": {
+ "NotFound": {
+ "description": "Entity not found."
+ },
+ "IllegalInput": {
+ "description": "Illegal input for operation."
+ },
+ "GeneralError": {
+ "description": "General Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GeneralError"
+ }
+ }
+ }
+ }
+ },
+ "securitySchemes": {
+ "api_key": {
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+ },
+ "petstore_auth": {
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "http://example.org/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ GeneralError:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ Category:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ parameters:
+ skipParam:
+ name: skip
+ in: query
+ description: number of items to skip
+ required: true
+ schema:
+ type: integer
+ format: int32
+ limitParam:
+ name: limit
+ in: query
+ description: max records to return
+ required: true
+ schema:
+ type: integer
+ format: int32
+ responses:
+ NotFound:
+ description: Entity not found.
+ IllegalInput:
+ description: Illegal input for operation.
+ GeneralError:
+ description: General Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GeneralError'
+ securitySchemes:
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: http://example.org/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+
+#### Paths Object
+
+Holds the relative paths to the individual endpoints and their operations.
+The path is appended to the URL from the [`Server Object`](#server-object) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#security-filtering).
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+/{path} | [Path Item Object](#path-item-object) | A relative path to an individual endpoint. The field name MUST begin with a forward slash (`/`). The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#server-object)'s `url` field in order to construct the full URL. [Path templating](#path-templating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Templating Matching
+
+Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
+
+```
+ /pets/{petId}
+ /pets/mine
+```
+
+The following paths are considered identical and invalid:
+
+```
+ /pets/{petId}
+ /pets/{name}
+```
+
+The following may lead to ambiguous resolution:
+
+```
+ /{entity}/me
+ /books/{id}
+```
+
+##### Paths Object Example
+
+```json
+{
+ "/pets": {
+ "get": {
+ "description": "Returns all pets from the system that the user has access to",
+ "responses": {
+ "200": {
+ "description": "A list of pets.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/pet"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+/pets:
+ get:
+ description: Returns all pets from the system that the user has access to
+ responses:
+ '200':
+ description: A list of pets.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/pet'
+```
+
+#### Path Item Object
+
+Describes the operations available on a single path.
+A Path Item MAY be empty, due to [ACL constraints](#security-filtering).
+The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#path-item-object). In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined.
+summary| `string` | An optional, string summary, intended to apply to all operations in this path.
+description | `string` | An optional, string description, intended to apply to all operations in this path. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+get | [Operation Object](#operation-object) | A definition of a GET operation on this path.
+put | [Operation Object](#operation-object) | A definition of a PUT operation on this path.
+post | [Operation Object](#operation-object) | A definition of a POST operation on this path.
+delete | [Operation Object](#operation-object) | A definition of a DELETE operation on this path.
+options | [Operation Object](#operation-object) | A definition of a OPTIONS operation on this path.
+head | [Operation Object](#operation-object) | A definition of a HEAD operation on this path.
+patch | [Operation Object](#operation-object) | A definition of a PATCH operation on this path.
+trace | [Operation Object](#operation-object) | A definition of a TRACE operation on this path.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service all operations in this path.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Item Object Example
+
+```json
+{
+ "get": {
+ "description": "Returns pets based on ID",
+ "summary": "Find pets by ID",
+ "operationId": "getPetsById",
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "error payload",
+ "content": {
+ "text/html": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "ID of pet to use",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "simple"
+ }
+ ]
+}
+```
+
+```yaml
+get:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: getPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*' :
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ 'text/html':
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+parameters:
+- name: id
+ in: path
+ description: ID of pet to use
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ style: simple
+```
+
+#### Operation Object
+
+Describes a single API operation on a path.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
+summary | `string` | A short summary of what the operation does.
+description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this operation.
+operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+requestBody | [Request Body Object](#request-body-object) \| [Reference Object](#reference-object) | The request body applicable for this operation. The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, `requestBody` SHALL be ignored by consumers.
+responses | [Responses Object](#responses-object) | **REQUIRED**. The list of possible responses as they are returned from executing this operation.
+callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callback-object) that describes a request that may be initiated by the API provider and the expected responses.
+deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. To make security optional, an empty security requirement (`{}`) can be included in the array. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Operation Object Example
+
+```json
+{
+ "tags": [
+ "pet"
+ ],
+ "summary": "Updates a pet in the store with form data",
+ "operationId": "updatePetWithForm",
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/x-www-form-urlencoded": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Updated name of the pet",
+ "type": "string"
+ },
+ "status": {
+ "description": "Updated status of the pet",
+ "type": "string"
+ }
+ },
+ "required": ["status"]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Pet updated.",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ },
+ "405": {
+ "description": "Method Not Allowed",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+}
+```
+
+```yaml
+tags:
+- pet
+summary: Updates a pet in the store with form data
+operationId: updatePetWithForm
+parameters:
+- name: petId
+ in: path
+ description: ID of pet that needs to be updated
+ required: true
+ schema:
+ type: string
+requestBody:
+ content:
+ 'application/x-www-form-urlencoded':
+ schema:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ required:
+ - status
+responses:
+ '200':
+ description: Pet updated.
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+ '405':
+ description: Method Not Allowed
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+security:
+- petstore_auth:
+ - write:pets
+ - read:pets
+```
+
+
+#### External Documentation Object
+
+Allows referencing an external resource for extended documentation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+url | `string` | **REQUIRED**. The URL for the target documentation. Value MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### External Documentation Object Example
+
+```json
+{
+ "description": "Find more info here",
+ "url": "https://example.com"
+}
+```
+
+```yaml
+description: Find more info here
+url: https://example.com
+```
+
+#### Parameter Object
+
+Describes a single operation parameter.
+
+A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
+
+##### Parameter Locations
+There are four possible parameter locations specified by the `in` field:
+* path - Used together with [Path Templating](#path-templating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
+* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
+* header - Custom headers that are expected as part of the request. Note that [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive.
+* cookie - Used to pass a specific cookie value to the API.
+
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*.
If [`in`](#parameterIn) is `"path"`, the `name` field MUST correspond to a template expression occurring within the [path](#pathsPath) field in the [Paths Object](#paths-object). See [Path Templating](#path-templating) for further information.
If [`in`](#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
For all other cases, the `name` corresponds to the parameter name used by the [`in`](#parameterIn) property.
+in | `string` | **REQUIRED**. The location of the parameter. Possible values are `"query"`, `"header"`, `"path"` or `"cookie"`.
+description | `string` | A brief description of the parameter. This could contain examples of use. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+required | `boolean` | Determines whether this parameter is mandatory. If the [parameter location](#parameterIn) is `"path"`, this property is **REQUIRED** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
+ deprecated | `boolean` | Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
+ allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows sending a parameter with an empty value. Default value is `false`. If [`style`](#parameterStyle) is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.
+
+The rules for serialization of the parameter are specified in one of two ways.
+For simpler scenarios, a [`schema`](#parameterSchema) and [`style`](#parameterStyle) can describe the structure and syntax of the parameter.
+
+Field Name | Type | Description
+---|:---:|---
+style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
+explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When [`style`](#parameterStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the type used for the parameter.
+example | Any | Example of the parameter's potential value. The example SHOULD match the specified schema and encoding properties if present. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` that contains an example, the `example` value SHALL _override_ the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the parameter's potential value. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` that contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+
+For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter.
+A parameter MUST contain either a `schema` property, or a `content` property, but not both.
+When `example` or `examples` are provided in conjunction with the `schema` object, the example MUST follow the prescribed serialization strategy for the parameter.
+
+
+Field Name | Type | Description
+---|:---:|---
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
+
+##### Style Values
+
+In order to support common ways of serializing simple parameters, a set of `style` values are defined.
+
+`style` | [`type`](#data-types) | `in` | Comments
+----------- | ------ | -------- | --------
+matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
+label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
+form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` with a `csv` (when `explode` is false) or `multi` (when `explode` is true) value from OpenAPI 2.0.
+simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2). This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0.
+spaceDelimited | `array` | `query` | Space separated array values. This option replaces `collectionFormat` equal to `ssv` from OpenAPI 2.0.
+pipeDelimited | `array` | `query` | Pipe separated array values. This option replaces `collectionFormat` equal to `pipes` from OpenAPI 2.0.
+deepObject | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
+
+
+##### Style Examples
+
+Assume a parameter named `color` has one of the following values:
+
+```
+ string -> "blue"
+ array -> ["blue","black","brown"]
+ object -> { "R": 100, "G": 200, "B": 150 }
+```
+The following table shows examples of rendering differences for each value.
+
+[`style`](#dataTypeFormat) | `explode` | `empty` | `string` | `array` | `object`
+----------- | ------ | -------- | -------- | -------- | -------
+matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150
+matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150
+label | false | . | .blue | .blue.black.brown | .R.100.G.200.B.150
+label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150
+form | false | color= | color=blue | color=blue,black,brown | color=R,100,G,200,B,150
+form | true | color= | color=blue | color=blue&color=black&color=brown | R=100&G=200&B=150
+simple | false | n/a | blue | blue,black,brown | R,100,G,200,B,150
+simple | true | n/a | blue | blue,black,brown | R=100,G=200,B=150
+spaceDelimited | false | n/a | n/a | blue%20black%20brown | R%20100%20G%20200%20B%20150
+pipeDelimited | false | n/a | n/a | blue\|black\|brown | R\|100\|G\|200\|B\|150
+deepObject | true | n/a | n/a | n/a | color[R]=100&color[G]=200&color[B]=150
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Parameter Object Examples
+
+A header parameter with an array of 64 bit integer numbers:
+
+```json
+{
+ "name": "token",
+ "in": "header",
+ "description": "token to be passed as a header",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "style": "simple"
+}
+```
+
+```yaml
+name: token
+in: header
+description: token to be passed as a header
+required: true
+schema:
+ type: array
+ items:
+ type: integer
+ format: int64
+style: simple
+```
+
+A path parameter of a string value:
+```json
+{
+ "name": "username",
+ "in": "path",
+ "description": "username to fetch",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+name: username
+in: path
+description: username to fetch
+required: true
+schema:
+ type: string
+```
+
+An optional query parameter of a string value, allowing multiple values by repeating the query parameter:
+```json
+{
+ "name": "id",
+ "in": "query",
+ "description": "ID of the object to fetch",
+ "required": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "form",
+ "explode": true
+}
+```
+
+```yaml
+name: id
+in: query
+description: ID of the object to fetch
+required: false
+schema:
+ type: array
+ items:
+ type: string
+style: form
+explode: true
+```
+
+A free-form query parameter, allowing undefined parameters of a specific type:
+```json
+{
+ "in": "query",
+ "name": "freeForm",
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ },
+ },
+ "style": "form"
+}
+```
+
+```yaml
+in: query
+name: freeForm
+schema:
+ type: object
+ additionalProperties:
+ type: integer
+style: form
+```
+
+A complex parameter using `content` to define serialization:
+
+```json
+{
+ "in": "query",
+ "name": "coordinates",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "lat",
+ "long"
+ ],
+ "properties": {
+ "lat": {
+ "type": "number"
+ },
+ "long": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+in: query
+name: coordinates
+content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - lat
+ - long
+ properties:
+ lat:
+ type: number
+ long:
+ type: number
+```
+
+#### Request Body Object
+
+Describes a single request body.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+content | Map[`string`, [Media Type Object](#media-type-object)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+required | `boolean` | Determines if the request body is required in the request. Defaults to `false`.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Request Body Examples
+
+A request body with a referenced model definition.
+```json
+{
+ "description": "user to add to the system",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User Example",
+ "externalValue": "http://foo.bar/examples/user-example.json"
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User example in XML",
+ "externalValue": "http://foo.bar/examples/user-example.xml"
+ }
+ }
+ },
+ "text/plain": {
+ "examples": {
+ "user" : {
+ "summary": "User example in Plain text",
+ "externalValue": "http://foo.bar/examples/user-example.txt"
+ }
+ }
+ },
+ "*/*": {
+ "examples": {
+ "user" : {
+ "summary": "User example in other format",
+ "externalValue": "http://foo.bar/examples/user-example.whatever"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User Example
+ externalValue: 'http://foo.bar/examples/user-example.json'
+ 'application/xml':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User Example in XML
+ externalValue: 'http://foo.bar/examples/user-example.xml'
+ 'text/plain':
+ examples:
+ user:
+ summary: User example in text plain format
+ externalValue: 'http://foo.bar/examples/user-example.txt'
+ '*/*':
+ examples:
+ user:
+ summary: User example in other format
+ externalValue: 'http://foo.bar/examples/user-example.whatever'
+```
+
+A body parameter that is an array of string values:
+```json
+{
+ "description": "user to add to the system",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+required: true
+content:
+ text/plain:
+ schema:
+ type: array
+ items:
+ type: string
+```
+
+
+#### Media Type Object
+Each Media Type Object provides schema and examples for the media type identified by its key.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the content of the request, response, or parameter.
+example | Any | Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+encoding | Map[`string`, [Encoding Object](#encoding-object)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Media Type Examples
+
+```json
+{
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ },
+ "examples": {
+ "cat" : {
+ "summary": "An example of a cat",
+ "value":
+ {
+ "name": "Fluffy",
+ "petType": "Cat",
+ "color": "White",
+ "gender": "male",
+ "breed": "Persian"
+ }
+ },
+ "dog": {
+ "summary": "An example of a dog with a cat's name",
+ "value" : {
+ "name": "Puma",
+ "petType": "Dog",
+ "color": "Black",
+ "gender": "Female",
+ "breed": "Mixed"
+ },
+ "frog": {
+ "$ref": "#/components/examples/frog-example"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ examples:
+ cat:
+ summary: An example of a cat
+ value:
+ name: Fluffy
+ petType: Cat
+ color: White
+ gender: male
+ breed: Persian
+ dog:
+ summary: An example of a dog with a cat's name
+ value:
+ name: Puma
+ petType: Dog
+ color: Black
+ gender: Female
+ breed: Mixed
+ frog:
+ $ref: "#/components/examples/frog-example"
+```
+
+##### Considerations for File Uploads
+
+In contrast with the 2.0 specification, `file` input/output content in OpenAPI is described with the same semantics as any other schema type. Specifically:
+
+```yaml
+# content transferred with base64 encoding
+schema:
+ type: string
+ format: base64
+```
+
+```yaml
+# content transferred in binary (octet-stream):
+schema:
+ type: string
+ format: binary
+```
+
+These examples apply to either input payloads of file uploads or response payloads.
+
+A `requestBody` for submitting a file in a `POST` operation may look like the following example:
+
+```yaml
+requestBody:
+ content:
+ application/octet-stream:
+ schema:
+ # a binary file of any type
+ type: string
+ format: binary
+```
+
+In addition, specific media types MAY be specified:
+
+```yaml
+# multiple, specific media types may be specified:
+requestBody:
+ content:
+ # a binary file of type png or jpeg
+ 'image/jpeg':
+ schema:
+ type: string
+ format: binary
+ 'image/png':
+ schema:
+ type: string
+ format: binary
+```
+
+To upload multiple files, a `multipart` media type MUST be used:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ # The property name 'file' will be used for all files.
+ file:
+ type: array
+ items:
+ type: string
+ format: binary
+
+```
+
+##### Support for x-www-form-urlencoded Request Bodies
+
+To submit content using form url encoding via [RFC1866](https://tools.ietf.org/html/rfc1866), the following
+definition may be used:
+
+```yaml
+requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # complex types are stringified to support RFC 1866
+ type: object
+ properties: {}
+```
+
+In this example, the contents in the `requestBody` MUST be stringified per [RFC1866](https://tools.ietf.org/html/rfc1866/) when passed to the server. In addition, the `address` field complex object will be stringified.
+
+When passing complex objects in the `application/x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the [`Encoding Object`](#encoding-object)'s [`style`](#encodingStyle) property as `form`.
+
+##### Special Considerations for `multipart` Content
+
+It is common to use `multipart/form-data` as a `Content-Type` when transferring request bodies to operations. In contrast to 2.0, a `schema` is REQUIRED to define the input parameters to the operation when using `multipart` content. This supports complex structures as well as supporting mechanisms for multiple file uploads.
+
+When passing in `multipart` types, boundaries MAY be used to separate sections of the content being transferred — thus, the following default `Content-Type`s are defined for `multipart`:
+
+* If the property is a primitive, or an array of primitive values, the default Content-Type is `text/plain`
+* If the property is complex, or an array of complex values, the default Content-Type is `application/json`
+* If the property is a `type: string` with `format: binary` or `format: base64` (aka a file object), the default Content-Type is `application/octet-stream`
+
+
+Examples:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # default Content-Type for objects is `application/json`
+ type: object
+ properties: {}
+ profileImage:
+ # default Content-Type for string/binary is `application/octet-stream`
+ type: string
+ format: binary
+ children:
+ # default Content-Type for arrays is based on the `inner` type (text/plain here)
+ type: array
+ items:
+ type: string
+ addresses:
+ # default Content-Type for arrays is based on the `inner` type (object shown, so `application/json` in this example)
+ type: array
+ items:
+ type: '#/components/schemas/Address'
+```
+
+An `encoding` attribute is introduced to give you control over the serialization of parts of `multipart` request bodies. This attribute is _only_ applicable to `multipart` and `application/x-www-form-urlencoded` request bodies.
+
+#### Encoding Object
+
+A single encoding definition applied to a single schema property.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+contentType | `string` | The Content-Type for encoding a specific property. Default value depends on the property type: for `string` with `format` being `binary` – `application/octet-stream`; for other primitive types – `text/plain`; for `object` - `application/json`; for `array` – the default is defined based on the inner type. The value can be a specific media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`), or a comma-separated list of the two types.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | A map allowing additional information to be provided as headers, for example `Content-Disposition`. `Content-Type` is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a `multipart`.
+style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameter-object) for details on the [`style`](#parameterStyle) property. The behavior follows the same values as `query` parameters, including default values. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+explode | `boolean` | When this is true, property values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When [`style`](#encodingStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Encoding Object Example
+
+```yaml
+requestBody:
+ content:
+ multipart/mixed:
+ schema:
+ type: object
+ properties:
+ id:
+ # default is text/plain
+ type: string
+ format: uuid
+ address:
+ # default is application/json
+ type: object
+ properties: {}
+ historyMetadata:
+ # need to declare XML format!
+ description: metadata in XML format
+ type: object
+ properties: {}
+ profileImage:
+ # default is application/octet-stream, need to declare an image type only!
+ type: string
+ format: binary
+ encoding:
+ historyMetadata:
+ # require XML Content-Type in utf-8 encoding
+ contentType: application/xml; charset=utf-8
+ profileImage:
+ # only accept png/jpeg
+ contentType: image/png, image/jpeg
+ headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+```
+
+#### Responses Object
+
+A container for the expected responses of an operation.
+The container maps a HTTP response code to the expected response.
+
+The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance.
+However, documentation is expected to cover a successful operation response and any known errors.
+
+The `default` MAY be used as a default response object for all HTTP codes
+that are not covered individually by the specification.
+
+The `Responses Object` MUST contain at least one response code, and it
+SHOULD be the response for a successful operation call.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+default | [Response Object](#response-object) \| [Reference Object](#reference-object) | The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. A [Reference Object](#reference-object) can link to a response that the [OpenAPI Object's components/responses](#componentsResponses) section defines.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+[HTTP Status Code](#http-status-codes) | [Response Object](#response-object) \| [Reference Object](#reference-object) | Any [HTTP status code](#http-status-codes) can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. A [Reference Object](#reference-object) can link to a response that is defined in the [OpenAPI Object's components/responses](#componentsResponses) section. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Responses Object Example
+
+A 200 response for a successful operation and a default response for others (implying an error):
+
+```json
+{
+ "200": {
+ "description": "a pet to be returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "Unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+'200':
+ description: a pet to be returned
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+```
+
+#### Response Object
+Describes a single response from an API Operation, including design-time, static
+`links` to operations based on the response.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | **REQUIRED**. A short description of the response. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | Maps a header name to its definition. [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing descriptions of potential response payloads. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for [Component Objects](#components-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Response Object Examples
+
+Response of an array of a complex type:
+
+```json
+{
+ "description": "A complex object array response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/VeryComplexType"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A complex object array response
+content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/VeryComplexType'
+```
+
+Response with a string type:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+```
+
+Plain text response with headers:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string",
+ "example": "whoa!"
+ }
+ }
+ },
+ "headers": {
+ "X-Rate-Limit-Limit": {
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Remaining": {
+ "description": "The number of remaining requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Reset": {
+ "description": "The number of seconds left in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+ example: 'whoa!'
+headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Remaining:
+ description: The number of remaining requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Reset:
+ description: The number of seconds left in the current period
+ schema:
+ type: integer
+```
+
+Response with no return value:
+
+```json
+{
+ "description": "object created"
+}
+```
+
+```yaml
+description: object created
+```
+
+#### Callback Object
+
+A map of possible out-of band callbacks related to the parent operation.
+Each value in the map is a [Path Item Object](#path-item-object) that describes a set of requests that may be initiated by the API provider and the expected responses.
+The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+{expression} | [Path Item Object](#path-item-object) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Key Expression
+
+The key that identifies the [Path Item Object](#path-item-object) is a [runtime expression](#runtime-expressions) that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.
+A simple example might be `$request.body#/url`.
+However, using a [runtime expression](#runtime-expressions) the complete HTTP message can be accessed.
+This includes accessing any part of a body that a JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) can reference.
+
+For example, given the following HTTP request:
+
+```http
+POST /subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning HTTP/1.1
+Host: example.org
+Content-Type: application/json
+Content-Length: 187
+
+{
+ "failedUrl" : "http://clientdomain.com/failed",
+ "successUrls" : [
+ "http://clientdomain.com/fast",
+ "http://clientdomain.com/medium",
+ "http://clientdomain.com/slow"
+ ]
+}
+
+201 Created
+Location: http://example.org/subscription/1
+```
+
+The following examples show how the various expressions evaluate, assuming the callback operation has a path parameter named `eventType` and a query parameter named `queryUrl`.
+
+Expression | Value
+---|:---
+$url | http://example.org/subscribe/myevent?queryUrl=http://clientdomain.com/stillrunning
+$method | POST
+$request.path.eventType | myevent
+$request.query.queryUrl | http://clientdomain.com/stillrunning
+$request.header.content-Type | application/json
+$request.body#/failedUrl | http://clientdomain.com/failed
+$request.body#/successUrls/2 | http://clientdomain.com/medium
+$response.header.Location | http://example.org/subscription/1
+
+
+##### Callback Object Examples
+
+The following example uses the user provided `queryUrl` query string parameter to define the callback URL. This is an example of how to use a callback object to describe a WebHook callback that goes with the subscription operation to enable registering for the WebHook.
+
+```yaml
+myCallback:
+ '{$request.query.queryUrl}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
+```
+
+The following example shows a callback where the server is hard-coded, but the query string parameters are populated from the `id` and `email` property in the request body.
+
+```yaml
+transactionCallback:
+ 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
+```
+
+#### Example Object
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+summary | `string` | Short description for the example.
+description | `string` | Long description for the example. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+value | Any | Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
+externalValue | `string` | A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `externalValue` field are mutually exclusive.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+In all cases, the example value is expected to be compatible with the type schema
+of its associated value. Tooling implementations MAY choose to
+validate compatibility automatically, and reject the example value(s) if incompatible.
+
+##### Example Object Examples
+
+In a request body:
+
+```yaml
+requestBody:
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Address'
+ examples:
+ foo:
+ summary: A foo example
+ value: {"foo": "bar"}
+ bar:
+ summary: A bar example
+ value: {"bar": "baz"}
+ 'application/xml':
+ examples:
+ xmlExample:
+ summary: This is an example in XML
+ externalValue: 'http://example.org/examples/address-example.xml'
+ 'text/plain':
+ examples:
+ textExample:
+ summary: This is a text example
+ externalValue: 'http://foo.bar/examples/address-example.txt'
+```
+
+In a parameter:
+
+```yaml
+parameters:
+ - name: 'zipCode'
+ in: 'query'
+ schema:
+ type: 'string'
+ format: 'zip-code'
+ examples:
+ zip-example:
+ $ref: '#/components/examples/zip-example'
+```
+
+In a response:
+
+```yaml
+responses:
+ '200':
+ description: your car appointment has been booked
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SuccessResponse'
+ examples:
+ confirmation-success:
+ $ref: '#/components/examples/confirmation-success'
+```
+
+
+#### Link Object
+
+The `Link object` represents a possible design-time link for a response.
+The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
+
+Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response.
+
+For computing links, and providing instructions to execute them, a [runtime expression](#runtime-expressions) is used for accessing values in an operation and using them as parameters while invoking the linked operation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+operationRef | `string` | A relative or absolute URI reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an [Operation Object](#operation-object). Relative `operationRef` values MAY be used to locate an existing [Operation Object](#operation-object) in the OpenAPI definition.
+operationId | `string` | The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
+parameters | Map[`string`, Any \| [{expression}](#runtime-expressions)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path.id).
+requestBody | Any \| [{expression}](#runtime-expressions) | A literal value or [{expression}](#runtime-expressions) to use as a request body when calling the target operation.
+description | `string` | A description of the link. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+server | [Server Object](#server-object) | A server object to be used by the target operation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+A linked operation MUST be identified using either an `operationRef` or `operationId`.
+In the case of an `operationId`, it MUST be unique and resolved in the scope of the OAS document.
+Because of the potential for name clashes, the `operationRef` syntax is preferred
+for specifications with external references.
+
+##### Examples
+
+Computing a link from a request operation where the `$request.path.id` is used to pass a request parameter to the linked operation.
+
+```yaml
+paths:
+ /users/{id}:
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ get:
+ responses:
+ '200':
+ description: the user being returned
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ uuid: # the unique user id
+ type: string
+ format: uuid
+ links:
+ address:
+ # the target link operationId
+ operationId: getUserAddress
+ parameters:
+ # get the `id` field from the request path parameter named `id`
+ userId: $request.path.id
+ # the path item of the linked operation
+ /users/{userid}/address:
+ parameters:
+ - name: userid
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ # linked operation
+ get:
+ operationId: getUserAddress
+ responses:
+ '200':
+ description: the user's address
+```
+
+When a runtime expression fails to evaluate, no parameter value is passed to the target operation.
+
+Values from the response body can be used to drive a linked operation.
+
+```yaml
+links:
+ address:
+ operationId: getUserAddressByUUID
+ parameters:
+ # get the `uuid` field from the `uuid` field in the response body
+ userUuid: $response.body#/uuid
+```
+
+Clients follow all links at their discretion.
+Neither permissions, nor the capability to make a successful call to that link, is guaranteed
+solely by the existence of a relationship.
+
+
+##### OperationRef Examples
+
+As references to `operationId` MAY NOT be possible (the `operationId` is an optional
+field in an [Operation Object](#operation-object)), references MAY also be made through a relative `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: '#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+or an absolute `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
+using JSON references.
+
+
+##### Runtime Expressions
+
+Runtime expressions allow defining values based on information that will only be available within the HTTP message in an actual API call.
+This mechanism is used by [Link Objects](#link-object) and [Callback Objects](#callback-object).
+
+The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
+
+```abnf
+ expression = ( "$url" / "$method" / "$statusCode" / "$request." source / "$response." source )
+ source = ( header-reference / query-reference / path-reference / body-reference )
+ header-reference = "header." token
+ query-reference = "query." name
+ path-reference = "path." name
+ body-reference = "body" ["#" json-pointer ]
+ json-pointer = *( "/" reference-token )
+ reference-token = *( unescaped / escaped )
+ unescaped = %x00-2E / %x30-7D / %x7F-10FFFF
+ ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'
+ escaped = "~" ( "0" / "1" )
+ ; representing '~' and '/', respectively
+ name = *( CHAR )
+ token = 1*tchar
+ tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
+ "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
+```
+
+Here, `json-pointer` is taken from [RFC 6901](https://tools.ietf.org/html/rfc6901), `char` from [RFC 7159](https://tools.ietf.org/html/rfc7159#section-7) and `token` from [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.6).
+
+The `name` identifier is case-sensitive, whereas `token` is not.
+
+The table below provides examples of runtime expressions and examples of their use in a value:
+
+##### Examples
+
+Source Location | example expression | notes
+---|:---|:---|
+HTTP Method | `$method` | The allowable values for the `$method` will be those for the HTTP operation.
+Requested media type | `$request.header.accept` |
+Request parameter | `$request.path.id` | Request parameters MUST be declared in the `parameters` section of the parent operation or they cannot be evaluated. This includes request headers.
+Request body property | `$request.body#/user/uuid` | In operations which accept payloads, references may be made to portions of the `requestBody` or the entire body.
+Request URL | `$url` |
+Response value | `$response.body#/status` | In operations which return payloads, references may be made to portions of the response body or the entire body.
+Response header | `$response.header.Server` | Single header values only are available
+
+Runtime expressions preserve the type of the referenced value.
+Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
+
+#### Header Object
+
+The Header Object follows the structure of the [Parameter Object](#parameter-object) with the following changes:
+
+1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
+1. `in` MUST NOT be specified, it is implicitly in `header`.
+1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, [`style`](#parameterStyle)).
+
+##### Header Object Example
+
+A simple header of type `integer`:
+
+```json
+{
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+}
+```
+
+```yaml
+description: The number of allowed requests in the current period
+schema:
+ type: integer
+```
+
+#### Tag Object
+
+Adds metadata to a single tag that is used by the [Operation Object](#operation-object).
+It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the tag.
+description | `string` | A short description for the tag. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this tag.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Tag Object Example
+
+```json
+{
+ "name": "pet",
+ "description": "Pets operations"
+}
+```
+
+```yaml
+name: pet
+description: Pets operations
+```
+
+
+#### Reference Object
+
+A simple object to allow referencing other components in the specification, internally and externally.
+
+The Reference Object is defined by [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) and follows the same structure, behavior and rules.
+
+For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | **REQUIRED**. The reference string.
+
+This object cannot be extended with additional properties and any properties added SHALL be ignored.
+
+##### Reference Object Example
+
+```json
+{
+ "$ref": "#/components/schemas/Pet"
+}
+```
+
+```yaml
+$ref: '#/components/schemas/Pet'
+```
+
+##### Relative Schema Document Example
+```json
+{
+ "$ref": "Pet.json"
+}
+```
+
+```yaml
+$ref: Pet.yaml
+```
+
+##### Relative Documents With Embedded Schema Example
+```json
+{
+ "$ref": "definitions.json#/Pet"
+}
+```
+
+```yaml
+$ref: definitions.yaml#/Pet
+```
+
+#### Schema Object
+
+The Schema Object allows the definition of input and output data types.
+These types can be objects, but also primitives and arrays.
+This object is an extended subset of the [JSON Schema Specification Wright Draft 00](https://json-schema.org/).
+
+For more information about the properties, see [JSON Schema Core](https://tools.ietf.org/html/draft-wright-json-schema-00) and [JSON Schema Validation](https://tools.ietf.org/html/draft-wright-json-schema-validation-00).
+Unless stated otherwise, the property definitions follow the JSON Schema.
+
+##### Properties
+
+The following properties are taken directly from the JSON Schema definition and follow the same specifications:
+
+- title
+- multipleOf
+- maximum
+- exclusiveMaximum
+- minimum
+- exclusiveMinimum
+- maxLength
+- minLength
+- pattern (This string SHOULD be a valid regular expression, according to the [Ecma-262 Edition 5.1 regular expression](https://www.ecma-international.org/ecma-262/5.1/#sec-15.10.1) dialect)
+- maxItems
+- minItems
+- uniqueItems
+- maxProperties
+- minProperties
+- required
+- enum
+
+The following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
+- type - Value MUST be a string. Multiple types via an array are not supported.
+- allOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- oneOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- anyOf - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- not - Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema.
+- items - Value MUST be an object and not an array. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema. `items` MUST be present if the `type` is `array`.
+- properties - Property definitions MUST be a [Schema Object](#schema-object) and not a standard JSON Schema (inline or referenced).
+- additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a [Schema Object](#schema-object) and not a standard JSON Schema. Consistent with JSON Schema, `additionalProperties` defaults to `true`.
+- description - [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+- format - See [Data Type Formats](#dataTypeFormat) for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
+- default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if `type` is `string`, then `default` can be `"foo"` but cannot be `1`.
+
+Alternatively, any time a Schema Object can be used, a [Reference Object](#reference-object) can be used in its place. This allows referencing definitions instead of defining them inline.
+
+Additional properties defined by the JSON Schema specification that are not mentioned here are strictly unsupported.
+
+Other than the JSON Schema subset fields, the following fields MAY be used for further schema documentation:
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+nullable | `boolean` | A `true` value adds `"null"` to the allowed type specified by the `type` keyword, only if `type` is explicitly defined within the same Schema Object. Other Schema Object constraints retain their defined behavior, and therefore may disallow the use of `null` as a value. A `false` value leaves the specified or default `type` unmodified. The default value is `false`.
+discriminator | [Discriminator Object](#discriminator-object) | Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](#composition-and-inheritance-polymorphism) for more details.
+readOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as `readOnly` being `true` and is in the `required` list, the `required` will take effect on the response only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
+writeOnly | `boolean` | Relevant only for Schema `"properties"` definitions. Declares the property as "write only". Therefore, it MAY be sent as part of a request but SHOULD NOT be sent as part of the response. If the property is marked as `writeOnly` being `true` and is in the `required` list, the `required` will take effect on the request only. A property MUST NOT be marked as both `readOnly` and `writeOnly` being `true`. Default value is `false`.
+xml | [XML Object](#xml-object) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this schema.
+example | Any | A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
+ deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+###### Composition and Inheritance (Polymorphism)
+
+The OpenAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition.
+`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
+
+While composition offers model extensibility, it does not imply a hierarchy between the models.
+To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
+When used, the `discriminator` will be the name of the property that decides which schema definition validates the structure of the model.
+As such, the `discriminator` field MUST be a required field.
+There are two ways to define the value of a discriminator for an inheriting instance.
+- Use the schema name.
+- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
+As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.
+
+###### XML Modeling
+
+The [xml](#schemaXml) property allows extra definitions when translating the JSON definition to XML.
+The [XML Object](#xml-object) contains additional information about the available options.
+
+##### Schema Object Examples
+
+###### Primitive Sample
+
+```json
+{
+ "type": "string",
+ "format": "email"
+}
+```
+
+```yaml
+type: string
+format: email
+```
+
+###### Simple Model
+
+```json
+{
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "address": {
+ "$ref": "#/components/schemas/Address"
+ },
+ "age": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ }
+ }
+}
+```
+
+```yaml
+type: object
+required:
+- name
+properties:
+ name:
+ type: string
+ address:
+ $ref: '#/components/schemas/Address'
+ age:
+ type: integer
+ format: int32
+ minimum: 0
+```
+
+###### Model with Map/Dictionary Properties
+
+For a simple string to string mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ type: string
+```
+
+For a string to model mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/ComplexModel"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ $ref: '#/components/schemas/ComplexModel'
+```
+
+###### Model with Example
+
+```json
+{
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "example": {
+ "name": "Puma",
+ "id": 1
+ }
+}
+```
+
+```yaml
+type: object
+properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+required:
+- name
+example:
+ name: Puma
+ id: 1
+```
+
+###### Models with Composition
+
+```json
+{
+ "components": {
+ "schemas": {
+ "ErrorModel": {
+ "type": "object",
+ "required": [
+ "message",
+ "code"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 600
+ }
+ }
+ },
+ "ExtendedErrorModel": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ErrorModel"
+ },
+ {
+ "type": "object",
+ "required": [
+ "rootCause"
+ ],
+ "properties": {
+ "rootCause": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ ErrorModel:
+ type: object
+ required:
+ - message
+ - code
+ properties:
+ message:
+ type: string
+ code:
+ type: integer
+ minimum: 100
+ maximum: 600
+ ExtendedErrorModel:
+ allOf:
+ - $ref: '#/components/schemas/ErrorModel'
+ - type: object
+ required:
+ - rootCause
+ properties:
+ rootCause:
+ type: string
+```
+
+###### Models with Polymorphism Support
+
+```json
+{
+ "components": {
+ "schemas": {
+ "Pet": {
+ "type": "object",
+ "discriminator": {
+ "propertyName": "petType"
+ },
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "petType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "petType"
+ ]
+ },
+ "Cat": {
+ "description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "huntingSkill": {
+ "type": "string",
+ "description": "The measured skill for hunting",
+ "default": "lazy",
+ "enum": [
+ "clueless",
+ "lazy",
+ "adventurous",
+ "aggressive"
+ ]
+ }
+ },
+ "required": [
+ "huntingSkill"
+ ]
+ }
+ ]
+ },
+ "Dog": {
+ "description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "packSize": {
+ "type": "integer",
+ "format": "int32",
+ "description": "the size of the pack the dog is from",
+ "default": 0,
+ "minimum": 0
+ }
+ },
+ "required": [
+ "packSize"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ discriminator:
+ propertyName: petType
+ properties:
+ name:
+ type: string
+ petType:
+ type: string
+ required:
+ - name
+ - petType
+ Cat: ## "Cat" will be used as the discriminator value
+ description: A representation of a cat
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ huntingSkill:
+ type: string
+ description: The measured skill for hunting
+ enum:
+ - clueless
+ - lazy
+ - adventurous
+ - aggressive
+ required:
+ - huntingSkill
+ Dog: ## "Dog" will be used as the discriminator value
+ description: A representation of a dog
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ packSize:
+ type: integer
+ format: int32
+ description: the size of the pack the dog is from
+ default: 0
+ minimum: 0
+ required:
+ - packSize
+```
+
+#### Discriminator Object
+
+When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
+
+When using the discriminator, _inline_ schemas will not be considered.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value.
+ mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or references.
+
+The discriminator object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`.
+
+In OAS 3.0, a response payload MAY be described to be exactly one of any number of types:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+```
+
+which means the payload _MUST_, by validation, match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. In this case, a discriminator MAY act as a "hint" to shortcut validation and selection of the matching schema which may be a costly operation, depending on the complexity of the schema. We can then describe exactly which field tells us which schema to use:
+
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ discriminator:
+ propertyName: petType
+```
+
+The expectation now is that a property with name `petType` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OAS document. Thus the response payload:
+
+```json
+{
+ "id": 12345,
+ "petType": "Cat"
+}
+```
+
+Will indicate that the `Cat` schema be used in conjunction with this payload.
+
+In scenarios where the value of the discriminator field does not match the schema name or implicit mapping is not possible, an optional `mapping` definition MAY be used:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ - $ref: 'https://gigantic-server.com/schemas/Monster/schema.json'
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: '#/components/schemas/Dog'
+ monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
+```
+
+Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Mapping keys MUST be string values, but tooling MAY convert response values to strings for comparison.
+
+When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
+
+In both the `oneOf` and `anyOf` use cases, all possible schemas MUST be listed explicitly. To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas comprising the parent schema in an `allOf` construct may be used as an alternate schema.
+
+For example:
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ required:
+ - petType
+ properties:
+ petType:
+ type: string
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: Dog
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Cat`
+ properties:
+ name:
+ type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Dog`
+ properties:
+ bark:
+ type: string
+ Lizard:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Lizard`
+ properties:
+ lovesRocks:
+ type: boolean
+```
+
+a payload like this:
+
+```json
+{
+ "petType": "Cat",
+ "name": "misty"
+}
+```
+
+will indicate that the `Cat` schema be used. Likewise this schema:
+
+```json
+{
+ "petType": "dog",
+ "bark": "soft"
+}
+```
+
+will map to `Dog` because of the definition in the `mappings` element.
+
+
+#### XML Object
+
+A metadata object that allows for more fine-tuned XML model definitions.
+
+When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information.
+See examples for expected behavior.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `array` (outside the `items`), it will affect the wrapping element and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored.
+namespace | `string` | The URI of the namespace definition. Value MUST be in the form of an absolute URI.
+prefix | `string` | The prefix to be used for the [name](#xmlName).
+attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
+wrapped | `boolean` | MAY be used only for an array definition. Signifies whether the array is wrapped (for example, ``) or unwrapped (``). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### XML Object Examples
+
+The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schema-object) with a sample of the XML representation of it.
+
+###### No XML Element
+
+Basic string property:
+
+```json
+{
+ "animals": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+```
+
+```xml
+...
+```
+
+Basic string array property ([`wrapped`](#xmlWrapped) is `false` by default):
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+```
+
+```xml
+...
+...
+...
+```
+
+###### XML Name Replacement
+
+```json
+{
+ "animals": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+...
+```
+
+
+###### XML Attribute, Prefix and Namespace
+
+In this example, a full model definition is shown.
+
+```json
+{
+ "Person": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "xml": {
+ "attribute": true
+ }
+ },
+ "name": {
+ "type": "string",
+ "xml": {
+ "namespace": "http://example.com/schema/sample",
+ "prefix": "sample"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+Person:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int32
+ xml:
+ attribute: true
+ name:
+ type: string
+ xml:
+ namespace: http://example.com/schema/sample
+ prefix: sample
+```
+
+```xml
+
+ example
+
+```
+
+###### XML Arrays
+
+Changing the element names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+value
+value
+```
+
+The external `name` property has no effect on the XML:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+```
+
+```xml
+value
+value
+```
+
+Even when the array is wrapped, if a name is not explicitly defined, the same name will be used both internally and externally:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+To overcome the naming problem in the example above, the following definition can be used:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+Affecting both internal and external names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+If we change the external element but not the internal ones:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+#### Security Scheme Object
+
+Defines a security scheme that can be used by the operations.
+Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows (implicit, password, client credentials and authorization code) as defined in [RFC6749](https://tools.ietf.org/html/rfc6749), and [OpenID Connect Discovery](https://tools.ietf.org/html/draft-ietf-oauth-discovery-06).
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+type | `string` | Any | **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"oauth2"`, `"openIdConnect"`.
+description | `string` | Any | A short description for security scheme. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+name | `string` | `apiKey` | **REQUIRED**. The name of the header, query or cookie parameter to be used.
+in | `string` | `apiKey` | **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"` or `"cookie"`.
+scheme | `string` | `http` | **REQUIRED**. The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-5.1). The values used SHOULD be registered in the [IANA Authentication Scheme registry](https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml).
+bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
+flows | [OAuth Flows Object](#oauth-flows-object) | `oauth2` | **REQUIRED**. An object containing configuration information for the flow types supported.
+openIdConnectUrl | `string` | `openIdConnect` | **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Security Scheme Object Example
+
+###### Basic Authentication Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "basic"
+}
+```
+
+```yaml
+type: http
+scheme: basic
+```
+
+###### API Key Sample
+
+```json
+{
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+}
+```
+
+```yaml
+type: apiKey
+name: api_key
+in: header
+```
+
+###### JWT Bearer Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "bearer",
+ "bearerFormat": "JWT",
+}
+```
+
+```yaml
+type: http
+scheme: bearer
+bearerFormat: JWT
+```
+
+###### Implicit OAuth2 Sample
+
+```json
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```yaml
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+#### OAuth Flows Object
+
+Allows configuration of the supported OAuth Flows.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+implicit| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Implicit flow
+password| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Resource Owner Password flow
+clientCredentials| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
+authorizationCode| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### OAuth Flow Object
+
+Configuration details for a supported OAuth Flow
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL.
+tokenUrl | `string` | `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`) | **REQUIRED**. The token URL to be used for this flow. This MUST be in the form of a URL.
+refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
+scopes | Map[`string`, `string`] | `oauth2` | **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### OAuth Flow Object Examples
+
+```JSON
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ },
+ "authorizationCode": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "tokenUrl": "https://example.com/api/oauth/token",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```yaml
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ authorizationCode:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+#### Security Requirement Object
+
+Lists the required security schemes to execute this operation.
+The name used for each property MUST correspond to a security scheme declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object).
+
+Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized.
+This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
+
+When a list of Security Requirement Objects is defined on the [OpenAPI Object](#openapi-object) or [Operation Object](#operation-object), only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MUST be empty.
+
+##### Security Requirement Object Examples
+
+###### Non-OAuth2 Security Requirement
+
+```json
+{
+ "api_key": []
+}
+```
+
+```yaml
+api_key: []
+```
+
+###### OAuth2 Security Requirement
+
+```json
+{
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+}
+```
+
+```yaml
+petstore_auth:
+- write:pets
+- read:pets
+```
+
+###### Optional OAuth2 Security
+
+Optional OAuth2 security as would be defined in an OpenAPI Object or an Operation Object:
+
+```json
+{
+ "security": [
+ {},
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+}
+```
+
+```yaml
+security:
+ - {}
+ - petstore_auth:
+ - write:pets
+ - read:pets
+```
+
+### Specification Extensions
+
+While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
+
+The extensions properties are implemented as patterned fields that are always prefixed by `"x-"`.
+
+Field Pattern | Type | Description
+---|:---:|---
+^x- | Any | Allows extensions to the OpenAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. Can have any valid JSON format value.
+
+The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).
+
+### Security Filtering
+
+Some objects in the OpenAPI Specification MAY be declared and remain empty, or be completely removed, even though they are inherently the core of the API documentation.
+
+The reasoning is to allow an additional layer of access control over the documentation.
+While not part of the specification itself, certain libraries MAY choose to allow access to parts of the documentation based on some form of authentication/authorization.
+
+Two examples of this:
+
+1. The [Paths Object](#paths-object) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#info-object) which may contain additional information regarding authentication.
+2. The [Path Item Object](#path-item-object) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different from hiding the path itself from the [Paths Object](#paths-object), because the user will be aware of its existence. This allows the documentation provider to finely control what the viewer can see.
+
+## Appendix A: Revision History
+
+Version | Date | Notes
+--- | --- | ---
+3.0.3 | 2020-02-20 | Patch release of the OpenAPI Specification 3.0.3
+3.0.2 | 2018-10-08 | Patch release of the OpenAPI Specification 3.0.2
+3.0.1 | 2017-12-06 | Patch release of the OpenAPI Specification 3.0.1
+3.0.0 | 2017-07-26 | Release of the OpenAPI Specification 3.0.0
+3.0.0-rc2 | 2017-06-16 | rc2 of the 3.0 specification
+3.0.0-rc1 | 2017-04-27 | rc1 of the 3.0 specification
+3.0.0-rc0 | 2017-02-28 | Implementer's Draft of the 3.0 specification
+2.0 | 2015-12-31 | Donation of Swagger 2.0 to the OpenAPI Initiative
+2.0 | 2014-09-08 | Release of Swagger 2.0
+1.2 | 2014-03-14 | Initial release of the formal document.
+1.1 | 2012-08-22 | Release of Swagger 1.1
+1.0 | 2011-08-10 | First release of the Swagger Specification
diff --git a/versions/3.1.0.md b/versions/3.1.0.md
new file mode 100644
index 0000000000..1f0830643f
--- /dev/null
+++ b/versions/3.1.0.md
@@ -0,0 +1,3468 @@
+# OpenAPI Specification
+
+#### Version 3.1.0
+
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
+
+This document is licensed under [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).
+
+## Introduction
+
+The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to HTTP APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.
+
+An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
+
+## Table of Contents
+
+
+- [Definitions](#definitions)
+ - [OpenAPI Document](#openapi-document)
+ - [Path Templating](#path-templating)
+ - [Media Types](#media-types)
+ - [HTTP Status Codes](#http-status-codes)
+- [Specification](#specification)
+ - [Versions](#versions)
+ - [Format](#format)
+ - [Document Structure](#document-structure)
+ - [Data Types](#data-types)
+ - [Rich Text Formatting](#rich-text-formatting)
+ - [Relative References In URIs](#relative-references-in-uris)
+ - [Relative References In URLs](#relative-references-in-urls)
+ - [Schema](#schema)
+ - [OpenAPI Object](#openapi-object)
+ - [Info Object](#info-object)
+ - [Contact Object](#contact-object)
+ - [License Object](#license-object)
+ - [Server Object](#server-object)
+ - [Server Variable Object](#server-variable-object)
+ - [Components Object](#components-object)
+ - [Paths Object](#paths-object)
+ - [Path Item Object](#path-item-object)
+ - [Operation Object](#operation-object)
+ - [External Documentation Object](#external-documentation-object)
+ - [Parameter Object](#parameter-object)
+ - [Request Body Object](#request-body-object)
+ - [Media Type Object](#media-type-object)
+ - [Encoding Object](#encoding-object)
+ - [Responses Object](#responses-object)
+ - [Response Object](#response-object)
+ - [Callback Object](#callback-object)
+ - [Example Object](#example-object)
+ - [Link Object](#link-object)
+ - [Header Object](#header-object)
+ - [Tag Object](#tag-object)
+ - [Reference Object](#reference-object)
+ - [Schema Object](#schema-object)
+ - [Discriminator Object](#discriminator-object)
+ - [XML Object](#xml-object)
+ - [Security Scheme Object](#security-scheme-object)
+ - [OAuth Flows Object](#oauth-flows-object)
+ - [OAuth Flow Object](#oauth-flow-object)
+ - [Security Requirement Object](#security-requirement-object)
+ - [Specification Extensions](#specification-extensions)
+ - [Security Filtering](#security-filtering)
+- [Appendix A: Revision History](#appendix-a-revision-history)
+
+
+
+
+## Definitions
+
+##### OpenAPI Document
+A self-contained or composite resource which defines or describes an API or elements of an API. The OpenAPI document MUST contain at least one [paths](#paths-object) field, a [components](#oasComponents) field or a [webhooks](#oasWebhooks) field. An OpenAPI document uses and conforms to the OpenAPI Specification.
+
+##### Path Templating
+Path templating refers to the usage of template expressions, delimited by curly braces ({}), to mark a section of a URL path as replaceable using path parameters.
+
+Each template expression in the path MUST correspond to a path parameter that is included in the [Path Item](#path-item-object) itself and/or in each of the Path Item's [Operations](#operation-object). An exception is if the path item is empty, for example due to ACL constraints, matching path parameters are not required.
+
+The value for these path parameters MUST NOT contain any unescaped "generic syntax" characters described by [RFC3986](https://tools.ietf.org/html/rfc3986#section-3): forward slashes (`/`), question marks (`?`), or hashes (`#`).
+
+##### Media Types
+Media type definitions are spread across several resources.
+The media type definitions SHOULD be in compliance with [RFC6838](https://tools.ietf.org/html/rfc6838).
+
+Some examples of possible media type definitions:
+```
+ text/plain; charset=utf-8
+ application/json
+ application/vnd.github+json
+ application/vnd.github.v3+json
+ application/vnd.github.v3.raw+json
+ application/vnd.github.v3.text+json
+ application/vnd.github.v3.html+json
+ application/vnd.github.v3.full+json
+ application/vnd.github.v3.diff
+ application/vnd.github.v3.patch
+```
+##### HTTP Status Codes
+The HTTP Status Codes are used to indicate the status of the executed operation.
+The available status codes are defined by [RFC7231](https://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
+
+## Specification
+
+### Versions
+
+The OpenAPI Specification is versioned using a `major`.`minor`.`patch` versioning scheme. The `major`.`minor` portion of the version string (for example `3.1`) SHALL designate the OAS feature set. *`.patch`* versions address errors in, or provide clarifications to, this document, not the feature set. Tooling which supports OAS 3.1 SHOULD be compatible with all OAS 3.1.\* versions. The patch version SHOULD NOT be considered by tooling, making no distinction between `3.1.0` and `3.1.1` for example.
+
+Occasionally, non-backwards compatible changes may be made in `minor` versions of the OAS where impact is believed to be low relative to the benefit provided.
+
+An OpenAPI document compatible with OAS 3.\*.\* contains a required [`openapi`](#oasVersion) field which designates the version of the OAS that it uses.
+
+### Format
+
+An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
+
+For example, if a field has an array value, the JSON array representation will be used:
+
+```json
+{
+ "field": [ 1, 2, 3 ]
+}
+```
+All field names in the specification are **case sensitive**.
+This includes all fields that are used as keys in a map, except where explicitly noted that keys are **case insensitive**.
+
+The schema exposes two types of fields: Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name.
+
+Patterned fields MUST have unique names within the containing object.
+
+In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](https://yaml.org/spec/1.2/spec.html) is RECOMMENDED along with some additional constraints:
+
+- Tags MUST be limited to those allowed by the [JSON Schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231).
+- Keys used in YAML maps MUST be limited to a scalar string, as defined by the [YAML Failsafe schema ruleset](https://yaml.org/spec/1.2/spec.html#id2802346).
+
+**Note:** While APIs may be defined by OpenAPI documents in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
+
+### Document Structure
+
+An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the author. In the latter case, [`Reference Objects`](#reference-object) and [`Schema Object`](#schema-object) `$ref` keywords are used.
+
+It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `openapi.yaml`.
+
+### Data Types
+
+Data types in the OAS are based on the types supported by the [JSON Schema Specification Draft 2020-12](https://tools.ietf.org/html/draft-bhutton-json-schema-00#section-4.2.1).
+Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
+Models are defined using the [Schema Object](#schema-object), which is a superset of JSON Schema Specification Draft 2020-12.
+
+As defined by the [JSON Schema Validation vocabulary](https://tools.ietf.org/html/draft-bhutton-json-schema-validation-00#section-7.3), data types can have an optional modifier property: `format`.
+OAS defines additional formats to provide fine detail for primitive data types.
+
+The formats defined by the OAS are:
+
+[`type`](#data-types) | [`format`](#dataTypeFormat) | Comments
+------ | -------- | --------
+`integer` | `int32` | signed 32 bits
+`integer` | `int64` | signed 64 bits (a.k.a long)
+`number` | `float` | |
+`number` | `double` | |
+`string` | `password` | A hint to UIs to obscure input.
+
+### Rich Text Formatting
+Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
+Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](https://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
+
+### Relative References in URIs
+
+Unless specified otherwise, all properties that are URIs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+
+Relative references, including those in [`Reference Objects`](#reference-object), [`PathItem Object`](#path-item-object) `$ref` fields, [`Link Object`](#link-object) `operationRef` fields and [`Example Object`](#example-object) `externalValue` fields, are resolved using the referring document as the Base URI according to [RFC3986](https://tools.ietf.org/html/rfc3986#section-5.2).
+
+If a URI contains a fragment identifier, then the fragment should be resolved per the fragment resolution mechanism of the referenced document. If the representation of the referenced document is JSON or YAML, then the fragment identifier SHOULD be interpreted as a JSON-Pointer as per [RFC6901](https://tools.ietf.org/html/rfc6901).
+
+Relative references in [`Schema Objects`](#schema-object), including any that appear as `$id` values, use the nearest parent `$id` as a Base URI, as described by [JSON Schema Specification Draft 2020-12](https://tools.ietf.org/html/draft-bhutton-json-schema-00#section-8.2). If no parent schema contains an `$id`, then the Base URI MUST be determined according to [RFC3986](https://tools.ietf.org/html/rfc3986#section-5.1).
+
+### Relative References in URLs
+
+Unless specified otherwise, all properties that are URLs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+Unless specified otherwise, relative references are resolved using the URLs defined in the [`Server Object`](#server-object) as a Base URL. Note that these themselves MAY be relative to the referring document.
+
+### Schema
+
+In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
+
+#### OpenAPI Object
+
+This is the root object of the [OpenAPI document](#openapi-document).
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+openapi | `string` | **REQUIRED**. This string MUST be the [version number](#versions) of the OpenAPI Specification that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling to interpret the OpenAPI document. This is *not* related to the API [`info.version`](#infoVersion) string.
+info | [Info Object](#info-object) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
+ jsonSchemaDialect | `string` | The default value for the `$schema` keyword within [Schema Objects](#schema-object) contained within this OAS document. This MUST be in the form of a URI.
+servers | [[Server Object](#server-object)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#serverUrl) value of `/`.
+paths | [Paths Object](#paths-object) | The available paths and operations for the API.
+webhooks | Map[`string`, [Path Item Object](#path-item-object) \| [Reference Object](#reference-object)] ] | The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the `callbacks` feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An [example](../examples/v3.1/webhook-example.yaml) is available.
+components | [Components Object](#components-object) | An element to hold various schemas for the document.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement (`{}`) can be included in the array.
+tags | [[Tag Object](#tag-object)] | A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operation-object) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Info Object
+
+The object provides metadata about the API.
+The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+title | `string` | **REQUIRED**. The title of the API.
+summary | `string` | A short summary of the API.
+description | `string` | A description of the API. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+termsOfService | `string` | A URL to the Terms of Service for the API. This MUST be in the form of a URL.
+contact | [Contact Object](#contact-object) | The contact information for the exposed API.
+license | [License Object](#license-object) | The license information for the exposed API.
+version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Info Object Example
+
+```json
+{
+ "title": "Sample Pet Store App",
+ "summary": "A pet store manager.",
+ "description": "This is a sample server for a pet store.",
+ "termsOfService": "https://example.com/terms/",
+ "contact": {
+ "name": "API Support",
+ "url": "https://www.example.com/support",
+ "email": "support@example.com"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
+ },
+ "version": "1.0.1"
+}
+```
+
+```yaml
+title: Sample Pet Store App
+summary: A pet store manager.
+description: This is a sample server for a pet store.
+termsOfService: https://example.com/terms/
+contact:
+ name: API Support
+ url: https://www.example.com/support
+ email: support@example.com
+license:
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+version: 1.0.1
+```
+
+#### Contact Object
+
+Contact information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | The identifying name of the contact person/organization.
+url | `string` | The URL pointing to the contact information. This MUST be in the form of a URL.
+email | `string` | The email address of the contact person/organization. This MUST be in the form of an email address.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Contact Object Example
+
+```json
+{
+ "name": "API Support",
+ "url": "https://www.example.com/support",
+ "email": "support@example.com"
+}
+```
+
+```yaml
+name: API Support
+url: https://www.example.com/support
+email: support@example.com
+```
+
+#### License Object
+
+License information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The license name used for the API.
+identifier | `string` | An [SPDX](https://spdx.org/licenses/) license expression for the API. The `identifier` field is mutually exclusive of the `url` field.
+url | `string` | A URL to the license used for the API. This MUST be in the form of a URL. The `url` field is mutually exclusive of the `identifier` field.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### License Object Example
+
+```json
+{
+ "name": "Apache 2.0",
+ "identifier": "Apache-2.0"
+}
+```
+
+```yaml
+name: Apache 2.0
+identifier: Apache-2.0
+```
+
+#### Server Object
+
+An object representing a Server.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
+description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+variables | Map[`string`, [Server Variable Object](#server-variable-object)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Server Object Example
+
+A single server would be described as:
+
+```json
+{
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+}
+```
+
+```yaml
+url: https://development.gigantic-server.com/v1
+description: Development server
+```
+
+The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+ },
+ {
+ "url": "https://staging.gigantic-server.com/v1",
+ "description": "Staging server"
+ },
+ {
+ "url": "https://api.gigantic-server.com/v1",
+ "description": "Production server"
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://development.gigantic-server.com/v1
+ description: Development server
+- url: https://staging.gigantic-server.com/v1
+ description: Staging server
+- url: https://api.gigantic-server.com/v1
+ description: Production server
+```
+
+The following shows how variables can be used for a server configuration:
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
+ "description": "The production API server",
+ "variables": {
+ "username": {
+ "default": "demo",
+ "description": "this value is assigned by the service provider, in this example `gigantic-server.com`"
+ },
+ "port": {
+ "enum": [
+ "8443",
+ "443"
+ ],
+ "default": "8443"
+ },
+ "basePath": {
+ "default": "v2"
+ }
+ }
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://{username}.gigantic-server.com:{port}/{basePath}
+ description: The production API server
+ variables:
+ username:
+ # note! no enum here means it is an open value
+ default: demo
+ description: this value is assigned by the service provider, in this example `gigantic-server.com`
+ port:
+ enum:
+ - '8443'
+ - '443'
+ default: '8443'
+ basePath:
+ # open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
+ default: v2
+```
+
+
+#### Server Variable Object
+
+An object representing a Server Variable for server URL template substitution.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+enum | [`string`] | An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty.
+default | `string` | **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. If the [`enum`](#serverVariableEnum) is defined, the value MUST exist in the enum's values.
+description | `string` | An optional description for the server variable. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Components Object
+
+Holds a set of reusable objects for different aspects of the OAS.
+All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
+
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---|---
+ schemas | Map[`string`, [Schema Object](#schema-object)] | An object to hold reusable [Schema Objects](#schema-object).
+ responses | Map[`string`, [Response Object](#response-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Response Objects](#response-object).
+ parameters | Map[`string`, [Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Parameter Objects](#parameter-object).
+ examples | Map[`string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Example Objects](#example-object).
+ requestBodies | Map[`string`, [Request Body Object](#request-body-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Request Body Objects](#request-body-object).
+ headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Header Objects](#header-object).
+ securitySchemes| Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object).
+ links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Link Objects](#link-object).
+ callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Callback Objects](#callback-object).
+ pathItems | Map[`string`, [Path Item Object](#path-item-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Path Item Object](#path-item-object).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`.
+
+Field Name Examples:
+
+```
+User
+User_1
+User_Name
+user-name
+my.org.User
+```
+
+##### Components Object Example
+
+```json
+"components": {
+ "schemas": {
+ "GeneralError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "Category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "Tag": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "skipParam": {
+ "name": "skip",
+ "in": "query",
+ "description": "number of items to skip",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "limitParam": {
+ "name": "limit",
+ "in": "query",
+ "description": "max records to return",
+ "required": true,
+ "schema" : {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ },
+ "responses": {
+ "NotFound": {
+ "description": "Entity not found."
+ },
+ "IllegalInput": {
+ "description": "Illegal input for operation."
+ },
+ "GeneralError": {
+ "description": "General Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GeneralError"
+ }
+ }
+ }
+ }
+ },
+ "securitySchemes": {
+ "api_key": {
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+ },
+ "petstore_auth": {
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.org/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ GeneralError:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ Category:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ parameters:
+ skipParam:
+ name: skip
+ in: query
+ description: number of items to skip
+ required: true
+ schema:
+ type: integer
+ format: int32
+ limitParam:
+ name: limit
+ in: query
+ description: max records to return
+ required: true
+ schema:
+ type: integer
+ format: int32
+ responses:
+ NotFound:
+ description: Entity not found.
+ IllegalInput:
+ description: Illegal input for operation.
+ GeneralError:
+ description: General Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GeneralError'
+ securitySchemes:
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: https://example.org/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+#### Paths Object
+
+Holds the relative paths to the individual endpoints and their operations.
+The path is appended to the URL from the [`Server Object`](#server-object) in order to construct the full URL. The Paths MAY be empty, due to [Access Control List (ACL) constraints](#security-filtering).
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+/{path} | [Path Item Object](#path-item-object) | A relative path to an individual endpoint. The field name MUST begin with a forward slash (`/`). The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#server-object)'s `url` field in order to construct the full URL. [Path templating](#path-templating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Templating Matching
+
+Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
+
+```
+ /pets/{petId}
+ /pets/mine
+```
+
+The following paths are considered identical and invalid:
+
+```
+ /pets/{petId}
+ /pets/{name}
+```
+
+The following may lead to ambiguous resolution:
+
+```
+ /{entity}/me
+ /books/{id}
+```
+
+##### Paths Object Example
+
+```json
+{
+ "/pets": {
+ "get": {
+ "description": "Returns all pets from the system that the user has access to",
+ "responses": {
+ "200": {
+ "description": "A list of pets.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/pet"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+/pets:
+ get:
+ description: Returns all pets from the system that the user has access to
+ responses:
+ '200':
+ description: A list of pets.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/pet'
+```
+
+#### Path Item Object
+
+Describes the operations available on a single path.
+A Path Item MAY be empty, due to [ACL constraints](#security-filtering).
+The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | Allows for a referenced definition of this path item. The referenced structure MUST be in the form of a [Path Item Object](#path-item-object). In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving [Relative References](#relative-references-in-uris).
+summary| `string` | An optional, string summary, intended to apply to all operations in this path.
+description | `string` | An optional, string description, intended to apply to all operations in this path. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+get | [Operation Object](#operation-object) | A definition of a GET operation on this path.
+put | [Operation Object](#operation-object) | A definition of a PUT operation on this path.
+post | [Operation Object](#operation-object) | A definition of a POST operation on this path.
+delete | [Operation Object](#operation-object) | A definition of a DELETE operation on this path.
+options | [Operation Object](#operation-object) | A definition of a OPTIONS operation on this path.
+head | [Operation Object](#operation-object) | A definition of a HEAD operation on this path.
+patch | [Operation Object](#operation-object) | A definition of a PATCH operation on this path.
+trace | [Operation Object](#operation-object) | A definition of a TRACE operation on this path.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service all operations in this path.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Path Item Object Example
+
+```json
+{
+ "get": {
+ "description": "Returns pets based on ID",
+ "summary": "Find pets by ID",
+ "operationId": "getPetsById",
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "error payload",
+ "content": {
+ "text/html": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "ID of pet to use",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "simple"
+ }
+ ]
+}
+```
+
+```yaml
+get:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: getPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*' :
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ 'text/html':
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+parameters:
+- name: id
+ in: path
+ description: ID of pet to use
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ style: simple
+```
+
+#### Operation Object
+
+Describes a single API operation on a path.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
+summary | `string` | A short summary of what the operation does.
+description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this operation.
+operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
+parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#reference-object) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+requestBody | [Request Body Object](#request-body-object) \| [Reference Object](#reference-object) | The request body applicable for this operation. The `requestBody` is fully supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as [GET](https://tools.ietf.org/html/rfc7231#section-4.3.1), [HEAD](https://tools.ietf.org/html/rfc7231#section-4.3.2) and [DELETE](https://tools.ietf.org/html/rfc7231#section-4.3.5)), `requestBody` is permitted but does not have well-defined semantics and SHOULD be avoided if possible.
+responses | [Responses Object](#responses-object) | The list of possible responses as they are returned from executing this operation.
+callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callback-object) that describes a request that may be initiated by the API provider and the expected responses.
+deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
+security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. To make security optional, an empty security requirement (`{}`) can be included in the array. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
+servers | [[Server Object](#server-object)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Operation Object Example
+
+```json
+{
+ "tags": [
+ "pet"
+ ],
+ "summary": "Updates a pet in the store with form data",
+ "operationId": "updatePetWithForm",
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/x-www-form-urlencoded": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Updated name of the pet",
+ "type": "string"
+ },
+ "status": {
+ "description": "Updated status of the pet",
+ "type": "string"
+ }
+ },
+ "required": ["status"]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Pet updated.",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ },
+ "405": {
+ "description": "Method Not Allowed",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+}
+```
+
+```yaml
+tags:
+- pet
+summary: Updates a pet in the store with form data
+operationId: updatePetWithForm
+parameters:
+- name: petId
+ in: path
+ description: ID of pet that needs to be updated
+ required: true
+ schema:
+ type: string
+requestBody:
+ content:
+ 'application/x-www-form-urlencoded':
+ schema:
+ type: object
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ required:
+ - status
+responses:
+ '200':
+ description: Pet updated.
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+ '405':
+ description: Method Not Allowed
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+security:
+- petstore_auth:
+ - write:pets
+ - read:pets
+```
+
+
+#### External Documentation Object
+
+Allows referencing an external resource for extended documentation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+url | `string` | **REQUIRED**. The URL for the target documentation. This MUST be in the form of a URL.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### External Documentation Object Example
+
+```json
+{
+ "description": "Find more info here",
+ "url": "https://example.com"
+}
+```
+
+```yaml
+description: Find more info here
+url: https://example.com
+```
+
+#### Parameter Object
+
+Describes a single operation parameter.
+
+A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
+
+##### Parameter Locations
+There are four possible parameter locations specified by the `in` field:
+* path - Used together with [Path Templating](#path-templating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
+* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
+* header - Custom headers that are expected as part of the request. Note that [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive.
+* cookie - Used to pass a specific cookie value to the API.
+
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*.
If [`in`](#parameterIn) is `"path"`, the `name` field MUST correspond to a template expression occurring within the [path](#pathsPath) field in the [Paths Object](#paths-object). See [Path Templating](#path-templating) for further information.
If [`in`](#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
For all other cases, the `name` corresponds to the parameter name used by the [`in`](#parameterIn) property.
+in | `string` | **REQUIRED**. The location of the parameter. Possible values are `"query"`, `"header"`, `"path"` or `"cookie"`.
+description | `string` | A brief description of the parameter. This could contain examples of use. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+required | `boolean` | Determines whether this parameter is mandatory. If the [parameter location](#parameterIn) is `"path"`, this property is **REQUIRED** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
+ deprecated | `boolean` | Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
+ allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows sending a parameter with an empty value. Default value is `false`. If [`style`](#parameterStyle) is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.
+
+The rules for serialization of the parameter are specified in one of two ways.
+For simpler scenarios, a [`schema`](#parameterSchema) and [`style`](#parameterStyle) can describe the structure and syntax of the parameter.
+
+Field Name | Type | Description
+---|:---:|---
+style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
+explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When [`style`](#parameterStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
+schema | [Schema Object](#schema-object) | The schema defining the type used for the parameter.
+example | Any | Example of the parameter's potential value. The example SHOULD match the specified schema and encoding properties if present. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` that contains an example, the `example` value SHALL _override_ the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the parameter's potential value. Each example SHOULD contain a value in the correct format as specified in the parameter encoding. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` that contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+
+For more complex scenarios, the [`content`](#parameterContent) property can define the media type and schema of the parameter.
+A parameter MUST contain either a `schema` property, or a `content` property, but not both.
+When `example` or `examples` are provided in conjunction with the `schema` object, the example MUST follow the prescribed serialization strategy for the parameter.
+
+
+Field Name | Type | Description
+---|:---:|---
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
+
+##### Style Values
+
+In order to support common ways of serializing simple parameters, a set of `style` values are defined.
+
+`style` | [`type`](#data-types) | `in` | Comments
+----------- | ------ | -------- | --------
+matrix | `primitive`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
+label | `primitive`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
+form | `primitive`, `array`, `object` | `query`, `cookie` | Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8). This option replaces `collectionFormat` with a `csv` (when `explode` is false) or `multi` (when `explode` is true) value from OpenAPI 2.0.
+simple | `array` | `path`, `header` | Simple style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.2). This option replaces `collectionFormat` with a `csv` value from OpenAPI 2.0.
+spaceDelimited | `array`, `object` | `query` | Space separated array or object values. This option replaces `collectionFormat` equal to `ssv` from OpenAPI 2.0.
+pipeDelimited | `array`, `object` | `query` | Pipe separated array or object values. This option replaces `collectionFormat` equal to `pipes` from OpenAPI 2.0.
+deepObject | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
+
+
+##### Style Examples
+
+Assume a parameter named `color` has one of the following values:
+
+```
+ string -> "blue"
+ array -> ["blue","black","brown"]
+ object -> { "R": 100, "G": 200, "B": 150 }
+```
+The following table shows examples of rendering differences for each value.
+
+[`style`](#style-values) | `explode` | `empty` | `string` | `array` | `object`
+----------- | ------ | -------- | -------- | -------- | -------
+matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150
+matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150
+label | false | . | .blue | .blue.black.brown | .R.100.G.200.B.150
+label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150
+form | false | color= | color=blue | color=blue,black,brown | color=R,100,G,200,B,150
+form | true | color= | color=blue | color=blue&color=black&color=brown | R=100&G=200&B=150
+simple | false | n/a | blue | blue,black,brown | R,100,G,200,B,150
+simple | true | n/a | blue | blue,black,brown | R=100,G=200,B=150
+spaceDelimited | false | n/a | n/a | blue%20black%20brown | R%20100%20G%20200%20B%20150
+pipeDelimited | false | n/a | n/a | blue\|black\|brown | R\|100\|G\|200\|B\|150
+deepObject | true | n/a | n/a | n/a | color[R]=100&color[G]=200&color[B]=150
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Parameter Object Examples
+
+A header parameter with an array of 64 bit integer numbers:
+
+```json
+{
+ "name": "token",
+ "in": "header",
+ "description": "token to be passed as a header",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ "style": "simple"
+}
+```
+
+```yaml
+name: token
+in: header
+description: token to be passed as a header
+required: true
+schema:
+ type: array
+ items:
+ type: integer
+ format: int64
+style: simple
+```
+
+A path parameter of a string value:
+```json
+{
+ "name": "username",
+ "in": "path",
+ "description": "username to fetch",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+name: username
+in: path
+description: username to fetch
+required: true
+schema:
+ type: string
+```
+
+An optional query parameter of a string value, allowing multiple values by repeating the query parameter:
+```json
+{
+ "name": "id",
+ "in": "query",
+ "description": "ID of the object to fetch",
+ "required": false,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "form",
+ "explode": true
+}
+```
+
+```yaml
+name: id
+in: query
+description: ID of the object to fetch
+required: false
+schema:
+ type: array
+ items:
+ type: string
+style: form
+explode: true
+```
+
+A free-form query parameter, allowing undefined parameters of a specific type:
+```json
+{
+ "in": "query",
+ "name": "freeForm",
+ "schema": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ },
+ },
+ "style": "form"
+}
+```
+
+```yaml
+in: query
+name: freeForm
+schema:
+ type: object
+ additionalProperties:
+ type: integer
+style: form
+```
+
+A complex parameter using `content` to define serialization:
+
+```json
+{
+ "in": "query",
+ "name": "coordinates",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "lat",
+ "long"
+ ],
+ "properties": {
+ "lat": {
+ "type": "number"
+ },
+ "long": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+in: query
+name: coordinates
+content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - lat
+ - long
+ properties:
+ lat:
+ type: number
+ long:
+ type: number
+```
+
+#### Request Body Object
+
+Describes a single request body.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+content | Map[`string`, [Media Type Object](#media-type-object)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+required | `boolean` | Determines if the request body is required in the request. Defaults to `false`.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Request Body Examples
+
+A request body with a referenced model definition.
+```json
+{
+ "description": "user to add to the system",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User Example",
+ "externalValue": "https://foo.bar/examples/user-example.json"
+ }
+ }
+ },
+ "application/xml": {
+ "schema": {
+ "$ref": "#/components/schemas/User"
+ },
+ "examples": {
+ "user" : {
+ "summary": "User example in XML",
+ "externalValue": "https://foo.bar/examples/user-example.xml"
+ }
+ }
+ },
+ "text/plain": {
+ "examples": {
+ "user" : {
+ "summary": "User example in Plain text",
+ "externalValue": "https://foo.bar/examples/user-example.txt"
+ }
+ }
+ },
+ "*/*": {
+ "examples": {
+ "user" : {
+ "summary": "User example in other format",
+ "externalValue": "https://foo.bar/examples/user-example.whatever"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User Example
+ externalValue: 'https://foo.bar/examples/user-example.json'
+ 'application/xml':
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User example in XML
+ externalValue: 'https://foo.bar/examples/user-example.xml'
+ 'text/plain':
+ examples:
+ user:
+ summary: User example in Plain text
+ externalValue: 'https://foo.bar/examples/user-example.txt'
+ '*/*':
+ examples:
+ user:
+ summary: User example in other format
+ externalValue: 'https://foo.bar/examples/user-example.whatever'
+```
+
+A body parameter that is an array of string values:
+```json
+{
+ "description": "user to add to the system",
+ "required": true,
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: user to add to the system
+required: true
+content:
+ text/plain:
+ schema:
+ type: array
+ items:
+ type: string
+```
+
+
+#### Media Type Object
+Each Media Type Object provides schema and examples for the media type identified by its key.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+schema | [Schema Object](#schema-object) | The schema defining the content of the request, response, or parameter.
+example | Any | Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` field is mutually exclusive of the `examples` field. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema.
+examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` field is mutually exclusive of the `example` field. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
+encoding | Map[`string`, [Encoding Object](#encoding-object)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Media Type Examples
+
+```json
+{
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ },
+ "examples": {
+ "cat" : {
+ "summary": "An example of a cat",
+ "value":
+ {
+ "name": "Fluffy",
+ "petType": "Cat",
+ "color": "White",
+ "gender": "male",
+ "breed": "Persian"
+ }
+ },
+ "dog": {
+ "summary": "An example of a dog with a cat's name",
+ "value" : {
+ "name": "Puma",
+ "petType": "Dog",
+ "color": "Black",
+ "gender": "Female",
+ "breed": "Mixed"
+ },
+ "frog": {
+ "$ref": "#/components/examples/frog-example"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+application/json:
+ schema:
+ $ref: "#/components/schemas/Pet"
+ examples:
+ cat:
+ summary: An example of a cat
+ value:
+ name: Fluffy
+ petType: Cat
+ color: White
+ gender: male
+ breed: Persian
+ dog:
+ summary: An example of a dog with a cat's name
+ value:
+ name: Puma
+ petType: Dog
+ color: Black
+ gender: Female
+ breed: Mixed
+ frog:
+ $ref: "#/components/examples/frog-example"
+```
+
+##### Considerations for File Uploads
+
+In contrast with the 2.0 specification, `file` input/output content in OpenAPI is described with the same semantics as any other schema type.
+
+In contrast with the 3.0 specification, the `format` keyword has no effect on the content-encoding of the schema. JSON Schema offers a `contentEncoding` keyword, which may be used to specify the `Content-Encoding` for the schema. The `contentEncoding` keyword supports all encodings defined in [RFC4648](https://tools.ietf.org/html/rfc4648), including "base64" and "base64url", as well as "quoted-printable" from [RFC2045](https://tools.ietf.org/html/rfc2045#section-6.7). The encoding specified by the `contentEncoding` keyword is independent of an encoding specified by the `Content-Type` header in the request or response or metadata of a multipart body -- when both are present, the encoding specified in the `contentEncoding` is applied first and then the encoding specified in the `Content-Type` header.
+
+JSON Schema also offers a `contentMediaType` keyword. However, when the media type is already specified by the Media Type Object's key, or by the `contentType` field of an [Encoding Object](#encoding-object), the `contentMediaType` keyword SHALL be ignored if present.
+
+Examples:
+
+Content transferred in binary (octet-stream) MAY omit `schema`:
+
+```yaml
+# a PNG image as a binary file:
+content:
+ image/png: {}
+```
+
+```yaml
+# an arbitrary binary file:
+content:
+ application/octet-stream: {}
+```
+
+Binary content transferred with base64 encoding:
+
+```yaml
+content:
+ image/png:
+ schema:
+ type: string
+ contentMediaType: image/png
+ contentEncoding: base64
+```
+
+Note that the `Content-Type` remains `image/png`, describing the semantics of the payload. The JSON Schema `type` and `contentEncoding` fields explain that the payload is transferred as text. The JSON Schema `contentMediaType` is technically redundant, but can be used by JSON Schema tools that may not be aware of the OpenAPI context.
+
+These examples apply to either input payloads of file uploads or response payloads.
+
+A `requestBody` for submitting a file in a `POST` operation may look like the following example:
+
+```yaml
+requestBody:
+ content:
+ application/octet-stream: {}
+```
+
+In addition, specific media types MAY be specified:
+
+```yaml
+# multiple, specific media types may be specified:
+requestBody:
+ content:
+ # a binary file of type png or jpeg
+ image/jpeg: {}
+ image/png: {}
+```
+
+To upload multiple files, a `multipart` media type MUST be used:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ # The property name 'file' will be used for all files.
+ file:
+ type: array
+ items: {}
+```
+
+As seen in the section on `multipart/form-data` below, the empty schema for `items` indicates a media type of `application/octet-stream`.
+
+##### Support for x-www-form-urlencoded Request Bodies
+
+To submit content using form url encoding via [RFC1866](https://tools.ietf.org/html/rfc1866), the following
+definition may be used:
+
+```yaml
+requestBody:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # complex types are stringified to support RFC 1866
+ type: object
+ properties: {}
+```
+
+In this example, the contents in the `requestBody` MUST be stringified per [RFC1866](https://tools.ietf.org/html/rfc1866/) when passed to the server. In addition, the `address` field complex object will be stringified.
+
+When passing complex objects in the `application/x-www-form-urlencoded` content type, the default serialization strategy of such properties is described in the [`Encoding Object`](#encoding-object)'s [`style`](#encodingStyle) property as `form`.
+
+##### Special Considerations for `multipart` Content
+
+It is common to use `multipart/form-data` as a `Content-Type` when transferring request bodies to operations. In contrast to 2.0, a `schema` is REQUIRED to define the input parameters to the operation when using `multipart` content. This supports complex structures as well as supporting mechanisms for multiple file uploads.
+
+In a `multipart/form-data` request body, each schema property, or each element of a schema array property, takes a section in the payload with an internal header as defined by [RFC7578](https://tools.ietf.org/html/rfc7578). The serialization strategy for each property of a `multipart/form-data` request body can be specified in an associated [`Encoding Object`](#encoding-object).
+
+When passing in `multipart` types, boundaries MAY be used to separate sections of the content being transferred – thus, the following default `Content-Type`s are defined for `multipart`:
+
+* If the property is a primitive, or an array of primitive values, the default Content-Type is `text/plain`
+* If the property is complex, or an array of complex values, the default Content-Type is `application/json`
+* If the property is a `type: string` with a `contentEncoding`, the default Content-Type is `application/octet-stream`
+
+Per the JSON Schema specification, `contentMediaType` without `contentEncoding` present is treated as if `contentEncoding: identity` were present. While useful for embedding text documents such as `text/html` into JSON strings, it is not useful for a `multipart/form-data` part, as it just causes the document to be treated as `text/plain` instead of its actual media type. Use the Encoding Object without `contentMediaType` if no `contentEncoding` is required.
+
+Examples:
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # default Content-Type for objects is `application/json`
+ type: object
+ properties: {}
+ profileImage:
+ # Content-Type for application-level encoded resource is `text/plain`
+ type: string
+ contentMediaType: image/png
+ contentEncoding: base64
+ children:
+ # default Content-Type for arrays is based on the _inner_ type (`text/plain` here)
+ type: array
+ items:
+ type: string
+ addresses:
+ # default Content-Type for arrays is based on the _inner_ type (object shown, so `application/json` in this example)
+ type: array
+ items:
+ type: object
+ $ref: '#/components/schemas/Address'
+```
+
+An `encoding` attribute is introduced to give you control over the serialization of parts of `multipart` request bodies. This attribute is _only_ applicable to `multipart` and `application/x-www-form-urlencoded` request bodies.
+
+#### Encoding Object
+
+A single encoding definition applied to a single schema property.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+contentType | `string` | The Content-Type for encoding a specific property. Default value depends on the property type: for `object` - `application/json`; for `array` – the default is defined based on the inner type; for all other cases the default is `application/octet-stream`. The value can be a specific media type (e.g. `application/json`), a wildcard media type (e.g. `image/*`), or a comma-separated list of the two types.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | A map allowing additional information to be provided as headers, for example `Content-Disposition`. `Content-Type` is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a `multipart`.
+style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameter-object) for details on the [`style`](#parameterStyle) property. The behavior follows the same values as `query` parameters, including default values. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encodingContentType) (implicit or explicit) SHALL be ignored.
+explode | `boolean` | When this is true, property values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When [`style`](#encodingStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encodingContentType) (implicit or explicit) SHALL be ignored.
+allowReserved | `boolean` | Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encodingContentType) (implicit or explicit) SHALL be ignored.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Encoding Object Example
+
+```yaml
+requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ id:
+ # default is text/plain
+ type: string
+ format: uuid
+ address:
+ # default is application/json
+ type: object
+ properties: {}
+ historyMetadata:
+ # need to declare XML format!
+ description: metadata in XML format
+ type: object
+ properties: {}
+ profileImage: {}
+ encoding:
+ historyMetadata:
+ # require XML Content-Type in utf-8 encoding
+ contentType: application/xml; charset=utf-8
+ profileImage:
+ # only accept png/jpeg
+ contentType: image/png, image/jpeg
+ headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+```
+
+#### Responses Object
+
+A container for the expected responses of an operation.
+The container maps a HTTP response code to the expected response.
+
+The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance.
+However, documentation is expected to cover a successful operation response and any known errors.
+
+The `default` MAY be used as a default response object for all HTTP codes
+that are not covered individually by the `Responses Object`.
+
+The `Responses Object` MUST contain at least one response code, and if only one
+response code is provided it SHOULD be the response for a successful operation
+call.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+default | [Response Object](#response-object) \| [Reference Object](#reference-object) | The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+[HTTP Status Code](#http-status-codes) | [Response Object](#response-object) \| [Reference Object](#reference-object) | Any [HTTP status code](#http-status-codes) can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
+
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Responses Object Example
+
+A 200 response for a successful operation and a default response for others (implying an error):
+
+```json
+{
+ "200": {
+ "description": "a pet to be returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "Unexpected error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+'200':
+ description: a pet to be returned
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+```
+
+#### Response Object
+Describes a single response from an API Operation, including design-time, static
+`links` to operations based on the response.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+description | `string` | **REQUIRED**. A description of the response. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | Maps a header name to its definition. [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive. If a response header is defined with the name `"Content-Type"`, it SHALL be ignored.
+content | Map[`string`, [Media Type Object](#media-type-object)] | A map containing descriptions of potential response payloads. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
+links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for [Component Objects](#components-object).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Response Object Examples
+
+Response of an array of a complex type:
+
+```json
+{
+ "description": "A complex object array response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/VeryComplexType"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A complex object array response
+content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/VeryComplexType'
+```
+
+Response with a string type:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+```
+
+Plain text response with headers:
+
+```json
+{
+ "description": "A simple string response",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string",
+ "example": "whoa!"
+ }
+ }
+ },
+ "headers": {
+ "X-Rate-Limit-Limit": {
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Remaining": {
+ "description": "The number of remaining requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ "X-Rate-Limit-Reset": {
+ "description": "The number of seconds left in the current period",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ }
+}
+```
+
+```yaml
+description: A simple string response
+content:
+ text/plain:
+ schema:
+ type: string
+ example: 'whoa!'
+headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Remaining:
+ description: The number of remaining requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Reset:
+ description: The number of seconds left in the current period
+ schema:
+ type: integer
+```
+
+Response with no return value:
+
+```json
+{
+ "description": "object created"
+}
+```
+
+```yaml
+description: object created
+```
+
+#### Callback Object
+
+A map of possible out-of band callbacks related to the parent operation.
+Each value in the map is a [Path Item Object](#path-item-object) that describes a set of requests that may be initiated by the API provider and the expected responses.
+The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+
+To describe incoming requests from the API provider independent from another API call, use the [`webhooks`](#oasWebhooks) field.
+
+##### Patterned Fields
+Field Pattern | Type | Description
+---|:---:|---
+{expression} | [Path Item Object](#path-item-object) \| [Reference Object](#reference-object) | A Path Item Object, or a reference to one, used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Key Expression
+
+The key that identifies the [Path Item Object](#path-item-object) is a [runtime expression](#runtime-expressions) that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.
+A simple example might be `$request.body#/url`.
+However, using a [runtime expression](#runtime-expressions) the complete HTTP message can be accessed.
+This includes accessing any part of a body that a JSON Pointer [RFC6901](https://tools.ietf.org/html/rfc6901) can reference.
+
+For example, given the following HTTP request:
+
+```http
+POST /subscribe/myevent?queryUrl=https://clientdomain.com/stillrunning HTTP/1.1
+Host: example.org
+Content-Type: application/json
+Content-Length: 187
+
+{
+ "failedUrl" : "https://clientdomain.com/failed",
+ "successUrls" : [
+ "https://clientdomain.com/fast",
+ "https://clientdomain.com/medium",
+ "https://clientdomain.com/slow"
+ ]
+}
+
+201 Created
+Location: https://example.org/subscription/1
+```
+
+The following examples show how the various expressions evaluate, assuming the callback operation has a path parameter named `eventType` and a query parameter named `queryUrl`.
+
+Expression | Value
+---|:---
+$url | https://example.org/subscribe/myevent?queryUrl=https://clientdomain.com/stillrunning
+$method | POST
+$request.path.eventType | myevent
+$request.query.queryUrl | https://clientdomain.com/stillrunning
+$request.header.content-Type | application/json
+$request.body#/failedUrl | https://clientdomain.com/failed
+$request.body#/successUrls/2 | https://clientdomain.com/medium
+$response.header.Location | https://example.org/subscription/1
+
+
+##### Callback Object Examples
+
+The following example uses the user provided `queryUrl` query string parameter to define the callback URL. This is an example of how to use a callback object to describe a WebHook callback that goes with the subscription operation to enable registering for the WebHook.
+
+```yaml
+myCallback:
+ '{$request.query.queryUrl}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
+```
+
+The following example shows a callback where the server is hard-coded, but the query string parameters are populated from the `id` and `email` property in the request body.
+
+```yaml
+transactionCallback:
+ 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
+```
+
+#### Example Object
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+summary | `string` | Short description for the example.
+description | `string` | Long description for the example. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+value | Any | Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
+externalValue | `string` | A URI that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The `value` field and `externalValue` field are mutually exclusive. See the rules for resolving [Relative References](#relative-references-in-uris).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+In all cases, the example value is expected to be compatible with the type schema
+of its associated value. Tooling implementations MAY choose to
+validate compatibility automatically, and reject the example value(s) if incompatible.
+
+##### Example Object Examples
+
+In a request body:
+
+```yaml
+requestBody:
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Address'
+ examples:
+ foo:
+ summary: A foo example
+ value: {"foo": "bar"}
+ bar:
+ summary: A bar example
+ value: {"bar": "baz"}
+ 'application/xml':
+ examples:
+ xmlExample:
+ summary: This is an example in XML
+ externalValue: 'https://example.org/examples/address-example.xml'
+ 'text/plain':
+ examples:
+ textExample:
+ summary: This is a text example
+ externalValue: 'https://foo.bar/examples/address-example.txt'
+```
+
+In a parameter:
+
+```yaml
+parameters:
+ - name: 'zipCode'
+ in: 'query'
+ schema:
+ type: 'string'
+ format: 'zip-code'
+ examples:
+ zip-example:
+ $ref: '#/components/examples/zip-example'
+```
+
+In a response:
+
+```yaml
+responses:
+ '200':
+ description: your car appointment has been booked
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SuccessResponse'
+ examples:
+ confirmation-success:
+ $ref: '#/components/examples/confirmation-success'
+```
+
+
+#### Link Object
+
+The `Link object` represents a possible design-time link for a response.
+The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
+
+Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response.
+
+For computing links, and providing instructions to execute them, a [runtime expression](#runtime-expressions) is used for accessing values in an operation and using them as parameters while invoking the linked operation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+operationRef | `string` | A relative or absolute URI reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an [Operation Object](#operation-object). Relative `operationRef` values MAY be used to locate an existing [Operation Object](#operation-object) in the OpenAPI definition. See the rules for resolving [Relative References](#relative-references-in-uris).
+operationId | `string` | The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
+parameters | Map[`string`, Any \| [{expression}](#runtime-expressions)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path.id).
+requestBody | Any \| [{expression}](#runtime-expressions) | A literal value or [{expression}](#runtime-expressions) to use as a request body when calling the target operation.
+description | `string` | A description of the link. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+server | [Server Object](#server-object) | A server object to be used by the target operation.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+A linked operation MUST be identified using either an `operationRef` or `operationId`.
+In the case of an `operationId`, it MUST be unique and resolved in the scope of the OAS document.
+Because of the potential for name clashes, the `operationRef` syntax is preferred
+for OpenAPI documents with external references.
+
+##### Examples
+
+Computing a link from a request operation where the `$request.path.id` is used to pass a request parameter to the linked operation.
+
+```yaml
+paths:
+ /users/{id}:
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ get:
+ responses:
+ '200':
+ description: the user being returned
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ uuid: # the unique user id
+ type: string
+ format: uuid
+ links:
+ address:
+ # the target link operationId
+ operationId: getUserAddress
+ parameters:
+ # get the `id` field from the request path parameter named `id`
+ userId: $request.path.id
+ # the path item of the linked operation
+ /users/{userid}/address:
+ parameters:
+ - name: userid
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ # linked operation
+ get:
+ operationId: getUserAddress
+ responses:
+ '200':
+ description: the user's address
+```
+
+When a runtime expression fails to evaluate, no parameter value is passed to the target operation.
+
+Values from the response body can be used to drive a linked operation.
+
+```yaml
+links:
+ address:
+ operationId: getUserAddressByUUID
+ parameters:
+ # get the `uuid` field from the `uuid` field in the response body
+ userUuid: $response.body#/uuid
+```
+
+Clients follow all links at their discretion.
+Neither permissions, nor the capability to make a successful call to that link, is guaranteed
+solely by the existence of a relationship.
+
+
+##### OperationRef Examples
+
+As references to `operationId` MAY NOT be possible (the `operationId` is an optional
+field in an [Operation Object](#operation-object)), references MAY also be made through a relative `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: '#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+or an absolute `operationRef`:
+
+```yaml
+links:
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get'
+ parameters:
+ username: $response.body#/username
+```
+
+Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
+using JSON references.
+
+
+##### Runtime Expressions
+
+Runtime expressions allow defining values based on information that will only be available within the HTTP message in an actual API call.
+This mechanism is used by [Link Objects](#link-object) and [Callback Objects](#callback-object).
+
+The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
+
+```abnf
+ expression = ( "$url" / "$method" / "$statusCode" / "$request." source / "$response." source )
+ source = ( header-reference / query-reference / path-reference / body-reference )
+ header-reference = "header." token
+ query-reference = "query." name
+ path-reference = "path." name
+ body-reference = "body" ["#" json-pointer ]
+ json-pointer = *( "/" reference-token )
+ reference-token = *( unescaped / escaped )
+ unescaped = %x00-2E / %x30-7D / %x7F-10FFFF
+ ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'
+ escaped = "~" ( "0" / "1" )
+ ; representing '~' and '/', respectively
+ name = *( CHAR )
+ token = 1*tchar
+ tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
+ "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
+```
+
+Here, `json-pointer` is taken from [RFC6901](https://tools.ietf.org/html/rfc6901), `char` from [RFC7159](https://tools.ietf.org/html/rfc7159#section-7) and `token` from [RFC7230](https://tools.ietf.org/html/rfc7230#section-3.2.6).
+
+The `name` identifier is case-sensitive, whereas `token` is not.
+
+The table below provides examples of runtime expressions and examples of their use in a value:
+
+##### Examples
+
+Source Location | example expression | notes
+---|:---|:---|
+HTTP Method | `$method` | The allowable values for the `$method` will be those for the HTTP operation.
+Requested media type | `$request.header.accept` |
+Request parameter | `$request.path.id` | Request parameters MUST be declared in the `parameters` section of the parent operation or they cannot be evaluated. This includes request headers.
+Request body property | `$request.body#/user/uuid` | In operations which accept payloads, references may be made to portions of the `requestBody` or the entire body.
+Request URL | `$url` |
+Response value | `$response.body#/status` | In operations which return payloads, references may be made to portions of the response body or the entire body.
+Response header | `$response.header.Server` | Single header values only are available
+
+Runtime expressions preserve the type of the referenced value.
+Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
+
+#### Header Object
+
+The Header Object follows the structure of the [Parameter Object](#parameter-object) with the following changes:
+
+1. `name` MUST NOT be specified, it is given in the corresponding `headers` map.
+1. `in` MUST NOT be specified, it is implicitly in `header`.
+1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, [`style`](#parameterStyle)).
+
+##### Header Object Example
+
+A simple header of type `integer`:
+
+```json
+{
+ "description": "The number of allowed requests in the current period",
+ "schema": {
+ "type": "integer"
+ }
+}
+```
+
+```yaml
+description: The number of allowed requests in the current period
+schema:
+ type: integer
+```
+
+#### Tag Object
+
+Adds metadata to a single tag that is used by the [Operation Object](#operation-object).
+It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the tag.
+description | `string` | A description for the tag. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this tag.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Tag Object Example
+
+```json
+{
+ "name": "pet",
+ "description": "Pets operations"
+}
+```
+
+```yaml
+name: pet
+description: Pets operations
+```
+
+
+#### Reference Object
+
+A simple object to allow referencing other components in the OpenAPI document, internally and externally.
+
+The `$ref` string value contains a URI [RFC3986](https://tools.ietf.org/html/rfc3986), which identifies the location of the value being referenced.
+
+See the rules for resolving [Relative References](#relative-references-in-uris).
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | **REQUIRED**. The reference identifier. This MUST be in the form of a URI.
+summary | `string` | A short summary which by default SHOULD override that of the referenced component. If the referenced object-type does not allow a `summary` field, then this field has no effect.
+description | `string` | A description which by default SHOULD override that of the referenced component. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. If the referenced object-type does not allow a `description` field, then this field has no effect.
+
+This object cannot be extended with additional properties and any properties added SHALL be ignored.
+
+Note that this restriction on additional properties is a difference between Reference Objects and [`Schema Objects`](#schema-object) that contain a `$ref` keyword.
+
+##### Reference Object Example
+
+```json
+{
+ "$ref": "#/components/schemas/Pet"
+}
+```
+
+```yaml
+$ref: '#/components/schemas/Pet'
+```
+
+##### Relative Schema Document Example
+```json
+{
+ "$ref": "Pet.json"
+}
+```
+
+```yaml
+$ref: Pet.yaml
+```
+
+##### Relative Documents With Embedded Schema Example
+```json
+{
+ "$ref": "definitions.json#/Pet"
+}
+```
+
+```yaml
+$ref: definitions.yaml#/Pet
+```
+
+#### Schema Object
+
+The Schema Object allows the definition of input and output data types.
+These types can be objects, but also primitives and arrays. This object is a superset of the [JSON Schema Specification Draft 2020-12](https://tools.ietf.org/html/draft-bhutton-json-schema-00).
+
+For more information about the properties, see [JSON Schema Core](https://tools.ietf.org/html/draft-bhutton-json-schema-00) and [JSON Schema Validation](https://tools.ietf.org/html/draft-bhutton-json-schema-validation-00).
+
+Unless stated otherwise, the property definitions follow those of JSON Schema and do not add any additional semantics.
+Where JSON Schema indicates that behavior is defined by the application (e.g. for annotations), OAS also defers the definition of semantics to the application consuming the OpenAPI document.
+
+##### Properties
+
+The OpenAPI Schema Object [dialect](https://tools.ietf.org/html/draft-bhutton-json-schema-00#section-4.3.3) is defined as requiring the [OAS base vocabulary](#fixed-fields-20), in addition to the vocabularies as specified in the JSON Schema draft 2020-12 [general purpose meta-schema](https://tools.ietf.org/html/draft-bhutton-json-schema-00#section-8).
+
+The OpenAPI Schema Object dialect for this version of the specification is identified by the URI `https://spec.openapis.org/oas/3.1/dialect/base` (the "OAS dialect schema id").
+
+The following properties are taken from the JSON Schema specification but their definitions have been extended by the OAS:
+
+- description - [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+- format - See [Data Type Formats](#dataTypeFormat) for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.
+
+In addition to the JSON Schema properties comprising the OAS dialect, the Schema Object supports keywords from any other vocabularies, or entirely arbitrary properties.
+
+The OpenAPI Specification's base vocabulary is comprised of the following keywords:
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+discriminator | [Discriminator Object](#discriminator-object) | Adds support for polymorphism. The discriminator is an object name that is used to differentiate between other schemas which may satisfy the payload description. See [Composition and Inheritance](#composition-and-inheritance-polymorphism) for more details.
+xml | [XML Object](#xml-object) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.
+externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this schema.
+example | Any | A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
**Deprecated:** The `example` property has been deprecated in favor of the JSON Schema `examples` keyword. Use of `example` is discouraged, and later versions of this specification may remove it.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions), though as noted, additional properties MAY omit the `x-` prefix within this object.
+
+###### Composition and Inheritance (Polymorphism)
+
+The OpenAPI Specification allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition.
+`allOf` takes an array of object definitions that are validated *independently* but together compose a single object.
+
+While composition offers model extensibility, it does not imply a hierarchy between the models.
+To support polymorphism, the OpenAPI Specification adds the `discriminator` field.
+When used, the `discriminator` will be the name of the property that decides which schema definition validates the structure of the model.
+As such, the `discriminator` field MUST be a required field.
+There are two ways to define the value of a discriminator for an inheriting instance.
+- Use the schema name.
+- Override the schema name by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
+As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.
+
+###### XML Modeling
+
+The [xml](#schemaXml) property allows extra definitions when translating the JSON definition to XML.
+The [XML Object](#xml-object) contains additional information about the available options.
+
+###### Specifying Schema Dialects
+
+It is important for tooling to be able to determine which dialect or meta-schema any given resource wishes to be processed with: JSON Schema Core, JSON Schema Validation, OpenAPI Schema dialect, or some custom meta-schema.
+
+The `$schema` keyword MAY be present in any root Schema Object, and if present MUST be used to determine which dialect should be used when processing the schema. This allows use of Schema Objects which comply with other drafts of JSON Schema than the default Draft 2020-12 support. Tooling MUST support the OAS dialect schema id, and MAY support additional values of `$schema`.
+
+To allow use of a different default `$schema` value for all Schema Objects contained within an OAS document, a `jsonSchemaDialect` value may be set within the OpenAPI Object. If this default is not set, then the OAS dialect schema id MUST be used for these Schema Objects. The value of `$schema` within a Schema Object always overrides any default.
+
+When a Schema Object is referenced from an external resource which is not an OAS document (e.g. a bare JSON Schema resource), then the value of the `$schema` keyword for schemas within that resource MUST follow [JSON Schema rules](https://tools.ietf.org/html/draft-bhutton-json-schema-00#section-8.1.1).
+
+##### Schema Object Examples
+
+###### Primitive Sample
+
+```json
+{
+ "type": "string",
+ "format": "email"
+}
+```
+
+```yaml
+type: string
+format: email
+```
+
+###### Simple Model
+
+```json
+{
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "address": {
+ "$ref": "#/components/schemas/Address"
+ },
+ "age": {
+ "type": "integer",
+ "format": "int32",
+ "minimum": 0
+ }
+ }
+}
+```
+
+```yaml
+type: object
+required:
+- name
+properties:
+ name:
+ type: string
+ address:
+ $ref: '#/components/schemas/Address'
+ age:
+ type: integer
+ format: int32
+ minimum: 0
+```
+
+###### Model with Map/Dictionary Properties
+
+For a simple string to string mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ type: string
+```
+
+For a string to model mapping:
+
+```json
+{
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/ComplexModel"
+ }
+}
+```
+
+```yaml
+type: object
+additionalProperties:
+ $ref: '#/components/schemas/ComplexModel'
+```
+
+###### Model with Example
+
+```json
+{
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "example": {
+ "name": "Puma",
+ "id": 1
+ }
+}
+```
+
+```yaml
+type: object
+properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+required:
+- name
+example:
+ name: Puma
+ id: 1
+```
+
+###### Models with Composition
+
+```json
+{
+ "components": {
+ "schemas": {
+ "ErrorModel": {
+ "type": "object",
+ "required": [
+ "message",
+ "code"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "integer",
+ "minimum": 100,
+ "maximum": 600
+ }
+ }
+ },
+ "ExtendedErrorModel": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ErrorModel"
+ },
+ {
+ "type": "object",
+ "required": [
+ "rootCause"
+ ],
+ "properties": {
+ "rootCause": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ ErrorModel:
+ type: object
+ required:
+ - message
+ - code
+ properties:
+ message:
+ type: string
+ code:
+ type: integer
+ minimum: 100
+ maximum: 600
+ ExtendedErrorModel:
+ allOf:
+ - $ref: '#/components/schemas/ErrorModel'
+ - type: object
+ required:
+ - rootCause
+ properties:
+ rootCause:
+ type: string
+```
+
+###### Models with Polymorphism Support
+
+```json
+{
+ "components": {
+ "schemas": {
+ "Pet": {
+ "type": "object",
+ "discriminator": {
+ "propertyName": "petType"
+ },
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "petType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "petType"
+ ]
+ },
+ "Cat": {
+ "description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "huntingSkill": {
+ "type": "string",
+ "description": "The measured skill for hunting",
+ "default": "lazy",
+ "enum": [
+ "clueless",
+ "lazy",
+ "adventurous",
+ "aggressive"
+ ]
+ }
+ },
+ "required": [
+ "huntingSkill"
+ ]
+ }
+ ]
+ },
+ "Dog": {
+ "description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Pet"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "packSize": {
+ "type": "integer",
+ "format": "int32",
+ "description": "the size of the pack the dog is from",
+ "default": 0,
+ "minimum": 0
+ }
+ },
+ "required": [
+ "packSize"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ discriminator:
+ propertyName: petType
+ properties:
+ name:
+ type: string
+ petType:
+ type: string
+ required:
+ - name
+ - petType
+ Cat: ## "Cat" will be used as the discriminator value
+ description: A representation of a cat
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ huntingSkill:
+ type: string
+ description: The measured skill for hunting
+ enum:
+ - clueless
+ - lazy
+ - adventurous
+ - aggressive
+ required:
+ - huntingSkill
+ Dog: ## "Dog" will be used as the discriminator value
+ description: A representation of a dog
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ packSize:
+ type: integer
+ format: int32
+ description: the size of the pack the dog is from
+ default: 0
+ minimum: 0
+ required:
+ - packSize
+```
+
+#### Discriminator Object
+
+When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the document of an alternative schema based on the value associated with it.
+
+When using the discriminator, _inline_ schemas will not be considered.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+propertyName | `string` | **REQUIRED**. The name of the property in the payload that will hold the discriminator value.
+ mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or references.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+The discriminator object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`.
+
+In OAS 3.0, a response payload MAY be described to be exactly one of any number of types:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+```
+
+which means the payload _MUST_, by validation, match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. In this case, a discriminator MAY act as a "hint" to shortcut validation and selection of the matching schema which may be a costly operation, depending on the complexity of the schema. We can then describe exactly which field tells us which schema to use:
+
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ discriminator:
+ propertyName: petType
+```
+
+The expectation now is that a property with name `petType` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OAS document. Thus the response payload:
+
+```json
+{
+ "id": 12345,
+ "petType": "Cat"
+}
+```
+
+Will indicate that the `Cat` schema be used in conjunction with this payload.
+
+In scenarios where the value of the discriminator field does not match the schema name or implicit mapping is not possible, an optional `mapping` definition MAY be used:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ - $ref: 'https://gigantic-server.com/schemas/Monster/schema.json'
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: '#/components/schemas/Dog'
+ monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
+```
+
+Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Mapping keys MUST be string values, but tooling MAY convert response values to strings for comparison.
+
+When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
+
+In both the `oneOf` and `anyOf` use cases, all possible schemas MUST be listed explicitly. To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas comprising the parent schema in an `allOf` construct may be used as an alternate schema.
+
+For example:
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ required:
+ - petType
+ properties:
+ petType:
+ type: string
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: Dog
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Cat`
+ properties:
+ name:
+ type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Dog`
+ properties:
+ bark:
+ type: string
+ Lizard:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Lizard`
+ properties:
+ lovesRocks:
+ type: boolean
+```
+
+a payload like this:
+
+```json
+{
+ "petType": "Cat",
+ "name": "misty"
+}
+```
+
+will indicate that the `Cat` schema be used. Likewise this schema:
+
+```json
+{
+ "petType": "dog",
+ "bark": "soft"
+}
+```
+
+will map to `Dog` because of the definition in the `mapping` element.
+
+
+#### XML Object
+
+A metadata object that allows for more fine-tuned XML model definitions.
+
+When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information.
+See examples for expected behavior.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `array` (outside the `items`), it will affect the wrapping element and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored.
+namespace | `string` | The URI of the namespace definition. This MUST be in the form of an absolute URI.
+prefix | `string` | The prefix to be used for the [name](#xmlName).
+attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
+wrapped | `boolean` | MAY be used only for an array definition. Signifies whether the array is wrapped (for example, ``) or unwrapped (``). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`).
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### XML Object Examples
+
+The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schema-object) with a sample of the XML representation of it.
+
+###### No XML Element
+
+Basic string property:
+
+```json
+{
+ "animals": {
+ "type": "string"
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+```
+
+```xml
+...
+```
+
+Basic string array property ([`wrapped`](#xmlWrapped) is `false` by default):
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+```
+
+```xml
+...
+...
+...
+```
+
+###### XML Name Replacement
+
+```json
+{
+ "animals": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+...
+```
+
+
+###### XML Attribute, Prefix and Namespace
+
+In this example, a full model definition is shown.
+
+```json
+{
+ "Person": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "xml": {
+ "attribute": true
+ }
+ },
+ "name": {
+ "type": "string",
+ "xml": {
+ "namespace": "https://example.com/schema/sample",
+ "prefix": "sample"
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+Person:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int32
+ xml:
+ attribute: true
+ name:
+ type: string
+ xml:
+ namespace: https://example.com/schema/sample
+ prefix: sample
+```
+
+```xml
+
+ example
+
+```
+
+###### XML Arrays
+
+Changing the element names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+```
+
+```xml
+value
+value
+```
+
+The external `name` property has no effect on the XML:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens"
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+```
+
+```xml
+value
+value
+```
+
+Even when the array is wrapped, if a name is not explicitly defined, the same name will be used both internally and externally:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+To overcome the naming problem in the example above, the following definition can be used:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+Affecting both internal and external names:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "xml": {
+ "name": "animal"
+ }
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: animal
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+If we change the external element but not the internal ones:
+
+```json
+{
+ "animals": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "xml": {
+ "name": "aliens",
+ "wrapped": true
+ }
+ }
+}
+```
+
+```yaml
+animals:
+ type: array
+ items:
+ type: string
+ xml:
+ name: aliens
+ wrapped: true
+```
+
+```xml
+
+ value
+ value
+
+```
+
+#### Security Scheme Object
+
+Defines a security scheme that can be used by the operations.
+
+Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, client credentials and authorization code) as defined in [RFC6749](https://tools.ietf.org/html/rfc6749), and [OpenID Connect Discovery](https://tools.ietf.org/html/draft-ietf-oauth-discovery-06).
+Please note that as of 2020, the implicit flow is about to be deprecated by [OAuth 2.0 Security Best Current Practice](https://tools.ietf.org/html/draft-ietf-oauth-security-topics). Recommended for most use case is Authorization Code Grant flow with PKCE.
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+type | `string` | Any | **REQUIRED**. The type of the security scheme. Valid values are `"apiKey"`, `"http"`, `"mutualTLS"`, `"oauth2"`, `"openIdConnect"`.
+description | `string` | Any | A description for security scheme. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
+name | `string` | `apiKey` | **REQUIRED**. The name of the header, query or cookie parameter to be used.
+in | `string` | `apiKey` | **REQUIRED**. The location of the API key. Valid values are `"query"`, `"header"` or `"cookie"`.
+scheme | `string` | `http` | **REQUIRED**. The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-5.1). The values used SHOULD be registered in the [IANA Authentication Scheme registry](https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml).
+bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
+flows | [OAuth Flows Object](#oauth-flows-object) | `oauth2` | **REQUIRED**. An object containing configuration information for the flow types supported.
+openIdConnectUrl | `string` | `openIdConnect` | **REQUIRED**. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL. The OpenID Connect standard requires the use of TLS.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### Security Scheme Object Example
+
+###### Basic Authentication Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "basic"
+}
+```
+
+```yaml
+type: http
+scheme: basic
+```
+
+###### API Key Sample
+
+```json
+{
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+}
+```
+
+```yaml
+type: apiKey
+name: api_key
+in: header
+```
+
+###### JWT Bearer Sample
+
+```json
+{
+ "type": "http",
+ "scheme": "bearer",
+ "bearerFormat": "JWT",
+}
+```
+
+```yaml
+type: http
+scheme: bearer
+bearerFormat: JWT
+```
+
+###### Implicit OAuth2 Sample
+
+```json
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```yaml
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+#### OAuth Flows Object
+
+Allows configuration of the supported OAuth Flows.
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+implicit| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Implicit flow
+password| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Resource Owner Password flow
+clientCredentials| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
+authorizationCode| [OAuth Flow Object](#oauth-flow-object) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### OAuth Flow Object
+
+Configuration details for a supported OAuth Flow
+
+##### Fixed Fields
+Field Name | Type | Applies To | Description
+---|:---:|---|---
+authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **REQUIRED**. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
+tokenUrl | `string` | `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`) | **REQUIRED**. The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
+refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
+scopes | Map[`string`, `string`] | `oauth2` | **REQUIRED**. The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+##### OAuth Flow Object Examples
+
+```JSON
+{
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ },
+ "authorizationCode": {
+ "authorizationUrl": "https://example.com/api/oauth/dialog",
+ "tokenUrl": "https://example.com/api/oauth/token",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+}
+```
+
+```yaml
+type: oauth2
+flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ authorizationCode:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+#### Security Requirement Object
+
+Lists the required security schemes to execute this operation.
+The name used for each property MUST correspond to a security scheme declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object).
+
+Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized.
+This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
+
+When a list of Security Requirement Objects is defined on the [OpenAPI Object](#openapi-object) or [Operation Object](#operation-object), only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+{name} | [`string`] | Each name MUST correspond to a security scheme which is declared in the [Security Schemes](#componentsSecuritySchemes) under the [Components Object](#components-object). If the security scheme is of type `"oauth2"` or `"openIdConnect"`, then the value is a list of scope names required for the execution, and the list MAY be empty if authorization does not require a specified scope. For other security scheme types, the array MAY contain a list of role names which are required for the execution, but are not otherwise defined or exchanged in-band.
+
+##### Security Requirement Object Examples
+
+###### Non-OAuth2 Security Requirement
+
+```json
+{
+ "api_key": []
+}
+```
+
+```yaml
+api_key: []
+```
+
+###### OAuth2 Security Requirement
+
+```json
+{
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+}
+```
+
+```yaml
+petstore_auth:
+- write:pets
+- read:pets
+```
+
+###### Optional OAuth2 Security
+
+Optional OAuth2 security as would be defined in an OpenAPI Object or an Operation Object:
+
+```json
+{
+ "security": [
+ {},
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+}
+```
+
+```yaml
+security:
+ - {}
+ - petstore_auth:
+ - write:pets
+ - read:pets
+```
+
+### Specification Extensions
+
+While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
+
+The extensions properties are implemented as patterned fields that are always prefixed by `"x-"`.
+
+Field Pattern | Type | Description
+---|:---:|---
+^x- | Any | Allows extensions to the OpenAPI Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. Field names beginning `x-oai-` and `x-oas-` are reserved for uses defined by the [OpenAPI Initiative](https://www.openapis.org/). The value can be `null`, a primitive, an array or an object.
+
+The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).
+
+### Security Filtering
+
+Some objects in the OpenAPI Specification MAY be declared and remain empty, or be completely removed, even though they are inherently the core of the API documentation.
+
+The reasoning is to allow an additional layer of access control over the documentation.
+While not part of the specification itself, certain libraries MAY choose to allow access to parts of the documentation based on some form of authentication/authorization.
+
+Two examples of this:
+
+1. The [Paths Object](#paths-object) MAY be present but empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They would still have access to at least the [Info Object](#info-object) which may contain additional information regarding authentication.
+2. The [Path Item Object](#path-item-object) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different from hiding the path itself from the [Paths Object](#paths-object), because the user will be aware of its existence. This allows the documentation provider to finely control what the viewer can see.
+
+
+## Appendix A: Revision History
+
+Version | Date | Notes
+--- | --- | ---
+3.1.0 | 2021-02-15 | Release of the OpenAPI Specification 3.1.0
+3.1.0-rc1 | 2020-10-08 | rc1 of the 3.1 specification
+3.1.0-rc0 | 2020-06-18 | rc0 of the 3.1 specification
+3.0.3 | 2020-02-20 | Patch release of the OpenAPI Specification 3.0.3
+3.0.2 | 2018-10-08 | Patch release of the OpenAPI Specification 3.0.2
+3.0.1 | 2017-12-06 | Patch release of the OpenAPI Specification 3.0.1
+3.0.0 | 2017-07-26 | Release of the OpenAPI Specification 3.0.0
+3.0.0-rc2 | 2017-06-16 | rc2 of the 3.0 specification
+3.0.0-rc1 | 2017-04-27 | rc1 of the 3.0 specification
+3.0.0-rc0 | 2017-02-28 | Implementer's Draft of the 3.0 specification
+2.0 | 2015-12-31 | Donation of Swagger 2.0 to the OpenAPI Initiative
+2.0 | 2014-09-08 | Release of Swagger 2.0
+1.2 | 2014-03-14 | Initial release of the formal document.
+1.1 | 2012-08-22 | Release of Swagger 1.1
+1.0 | 2011-08-10 | First release of the Swagger Specification