pax_global_header 0000666 0000000 0000000 00000000064 14013016525 0014507 g ustar 00root root 0000000 0000000 52 comment=42a9e3d4eddade52363a5c4fac852e80681c2fe5
OpenAPI-Specification-3.1.0/ 0000775 0000000 0000000 00000000000 14013016525 0015521 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/.github/ 0000775 0000000 0000000 00000000000 14013016525 0017061 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14013016525 0021116 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/.github/workflows/convert-examples-to-json.yaml 0000664 0000000 0000000 00000002575 14013016525 0026676 0 ustar 00root root 0000000 0000000 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 master
on:
push:
branches:
- master
jobs:
yaml2json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1 # checkout repo content
- name: Install dependencies
run: npm i
- 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@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch-suffix: none
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.
OpenAPI-Specification-3.1.0/.github/workflows/validate-markdown.yaml 0000664 0000000 0000000 00000001252 14013016525 0025413 0 ustar 00root root 0000000 0000000 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@v1 # checkout repo content
- uses: actions/setup-node@v1 # setup Node.js
with:
node-version: '12.x'
- name: Validate markdown
run: npx mdv versions/3.*.md
OpenAPI-Specification-3.1.0/.gitignore 0000664 0000000 0000000 00000000145 14013016525 0017511 0 ustar 00root root 0000000 0000000 .idea
*.iml
*.ipr
*.iws
target
atlassian-ide-plugin.xml
node_modules/
package-lock.json
Gemfile.lock
OpenAPI-Specification-3.1.0/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000011353 14013016525 0020323 0 ustar 00root root 0000000 0000000 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.
Further details of specific enforcement policies are currently being
drafted. When these details are completed we will post updates to our
website for transparency.
Project maintainers who do not report possible incidents or follow
responses in good faith may face temporary or permanent repercussions as
determined by the Code of Conduct Committee.
### 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/).
OpenAPI-Specification-3.1.0/CONTRIBUTORS.md 0000664 0000000 0000000 00000001007 14013016525 0017776 0 ustar 00root root 0000000 0000000 * Darrel Miller [@darrelmiller](https://github.com/darrelmiller)
* Jason Harmon [@jharmn](https://github.com/jharmn)
* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc)
* Kris Hahn [@KrisHahn](https://github.com/krishahn)
* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh)
* Mike Ralphson [@MikeRalphson](https://github.com/mikeralphson)
* Rob Dolin [@RobDolinMS](https://github.com/robdolinms)
* Ron Ratovsky [@webron](https://github.com/webron)
* Tony Tam [@fehguy](https://github.com/fehguy)
OpenAPI-Specification-3.1.0/DEVELOPMENT.md 0000664 0000000 0000000 00000022474 14013016525 0017636 0 ustar 00root root 0000000 0000000 ## Development Guidelines
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.
## 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.
## Specification Change Criteria
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 2.0 specification? 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.
## Tracking Process
* GitHub is the medium of record 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).
* 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:
* master - 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 master branch shall remain the current, released OpenAPI Specification. We will describe and link the work branch(es) 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/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.
* When the work branch is ready and approved, the branch will be merged to master.
## Release Process
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 Master with marketing support, if any.
* Patch-level releases require majority approval by TSC members. (Max voting period 3 days)
* 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)
## Draft Features
Where suitable, features will be introduced as draft but OAI approved extensions.
By introducing new features this way we enable new features to be designed, documented and then implemented by tools that are interested in the feature, without putting the burden of implementation on all tooling.
If the feature is successfully implemented and there is demonstrable value added by the feature, it will become a candidate for inclusion in a future release of the specification, at which point all tools will be expected to support the feature.
Draft feature extensions are identified by the `x-oas-draft-` prefix and can only be used where existing extensions are permitted.
This ensures no existing tooling will affected by the introduction of the draft feature.
If the feature is deemed appropriate for inclusion in the OAS, the `x-oas-draft-` prefix will be removed.
Tooling that supports draft features should plan for the future removal of the prefix.
When tooling adds support for a later version of OAS that includes the final implementation of the feature, it MUST not support the use of the draft prefix for that feature.
Draft features will only be promoted into minor or major releases of the specification and therefore will be transparent to OpenAPI description writers and tooling providers who choose not to use the feature while in its draft state.
Draft features will be documented as GitHub issues and labeled with the `draft-feature` label and will be initially labelled as `draft:proposal`. When the proposal is considered sufficiently stable for pilot implementation, it will be labeled `draft:pilot`.
If during the development of a draft feature, it is determined that the feature needs to change in a way that may break existing draft implementations, the extension name itself may be versioned with a version suffix. e.g. `-v2`
When a draft feature becomes part of a future update to the specification any version suffix will be removed.
Draft features that are deemed not appropriate for inclusion MUST be marked with the `draft:abandoned` label.
Draft-features that are considered suitably specified and have had successful pilot implementations will be marked with the `draft:graduated` label.
Not all future new features will be introduced in this way.
Some new features impact the specification in ways that cannot be encapsulated in an extension.
However, where a new feature can be introduced in this way, it should be.
## Transparency
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.
## 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
* 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.
OpenAPI-Specification-3.1.0/GOVERNANCE.md 0000664 0000000 0000000 00000006576 14013016525 0017510 0 ustar 00root root 0000000 0000000 # 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.
* [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 through [@OpenApiSpec](https://twitter.com/OpenApiSpec) on Twitter, 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 4-6 weeks (to be determined at start of each nominating period), though nominees have no voting rights. The provisional period is concluded by a second, confidential vote similar to the nomination period's vote. 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
In dire situations, it may be necessary to remove a TSC member, such as behavior that violates the code of conduct (NB: whether non-participation merits removal is a decision left to the TSC voting members). 75% 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 Liaison of their effective resignation date.
## 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.
OpenAPI-Specification-3.1.0/IMPLEMENTATIONS.md 0000664 0000000 0000000 00000027335 14013016525 0020325 0 ustar 00root root 0000000 0000000 ### Implementations
Below is a list of known tooling that implements the 3.0.0 specification. While support for the 3.0.0 specification matures, refer to the details of projects listed below for any notes about stability and roadmap. The process to improve the 3.x specification includes feedback from end-users and tooling creators. We strongly encourage draft tooling be made available for early users of OAS drafts.
These tools are not endorsed by the OAI.
#### Low-Level tooling
| Title | Project Link | Language |Description |
|----------------|--------------|----------|---------------------|
| swagger-parser | [github/swagger-api](https://github.com/swagger-api/swagger-parser) | Java | Swagger 1.0, 1.1, 1.2, 2.0 to OpenAPI Specification converter |
| swagger-models | [github/swagger-api](https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-models) | Java | OpenAPI 3.0 Java Pojos |
| springdoc-openapi | [github/springdoc/springdoc-openapi](https://github.com/springdoc/springdoc-openapi) | Java | Library that produces OpenAPI 3.x specification documentation for spring-boot applications. |
| 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 |
| Microsoft.OpenApi.net | [github/microsoft/OpenApi.net](https://github.com/microsoft/openapi.net/) | dotnet | C# based parser with definition validation and migration support from V2 |
| odata-openapi | [github/oasis-tcs/odata-openapi](https://github.com/oasis-tcs/odata-openapi) | XSLT | OData 4.0 to OpenAPI 3.0.0 converter |
| openapi3_parser | [github/kevindew/openapi3_parser](https://github.com/kevindew/openapi3_parser) | Ruby | A Ruby implementation of parser and validator for the OpenAPI 3 Specification |
| oas_parser | [github/Nexmo/oas_parser](https://github.com/Nexmo/oas_parser) | Ruby | An open source OpenAPI Spec 3 Definition Parser written in Ruby |
| oas3-remote-refs | [github//OverSpeedIO/oas3-remote-refs](https://github.com/OverSpeedIO/oas3-remote-refs) | Node.js | Tool to pull remote references and merge them into the definitions of the provided OpenAPI3 specification.
| go-openapi | [github/nasa9084/go-openapi](https://github.com/nasa9084/go-openapi) | Go | Golang struct model for OpenAPI 3.x. |
| openapi | [github/wzshiming/openapi](https://github.com/wzshiming/openapi) | Go | OpenAPI 3 Specification for golang |
| kin-openapi | [github/getkin/kin-openapi](https://github.com/getkin/kin-openapi) | Go | OpenAPI 3.x implementation for Go (parsing, converting, validation) |
| Spectral | [github/stoplightio/spectral](https://github.com/stoplightio/spectral) | TypeScript, JavaScript | A flexible JSON object linter with out of the box support for OpenAPI Specification 2 and 3 |
| openapi-validator | [gitlab/mmal/openapi-validator](https://gitlab.com/mmalawski/openapi-validator) | PHP | Validates response against OpenAPI schema |
| OpenAPI-Delphi | [github/paolo-rossi/OpenAPI-Delphi](https://github.com/paolo-rossi/OpenAPI-Delphi) | Delphi | Delphi implementation of a generator, parser and validator for the OpenAPI 3 Specification |
| spring-openapi | [github/jrcodeza/spring-openapi](https://github.com/jrcodeza/spring-openapi) | Java | OpenAPI v3 generator for Java Spring. Includes also client generation. Supports inheritance with discriminators and Jackson annotations and custom interceptors. |
#### Editors
| Title | Project Link | Language |Description |
|----------------|--------------|----------|---------------------|
| Visual Studio Code extension | [VS Code marketplace / OpenAPI (Swagger) editor](https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi) | TypeScript | Extends VS Code to provide OpenAPI 2.0 and 3.0 navigation, code snippets, new API creation |
| Apicurio Studio | [github/Apicurio/apicurio-studio](https://github.com/Apicurio/apicurio-studio) | Java/TypeScript | Web-Based **visual designer** for OpenAPI 2.0 and 3.0.0. |
| 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 definitions |
| SwaggerHub | [swaggerhub.com](https://swaggerhub.com) | | API Design and Documentation Platform, Built For Teams
| swagger-editor | [github/swagger-api](https://github.com/swagger-api/swagger-editor) | JavaScript | Web-Based editor for creating, editing, validating and testing OpenAPI\Swagger definitions |
| Remain OpenAPI Studio | Direct download: https://remainsoftware.com/extranet/download-type/openapi-studio-download
Or via Eclipse MarketPlace https://marketplace.eclipse.org/content/openapi-studio-rich-oas3-editor | Java | A user-friendly, visually rich studio supporting all features defined by the OpenAPI 3. Easy but powerful UI-based components creation, API testing, import, export, code generation and much more. |
#### 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. |
| swagger-ui | [github/swagger-api](https://github.com/swagger-api/swagger-UI) | JavaScript | Web-Based interface for visualizing and testing OpenAPI\Swagger definitions |
| lincoln | [github/temando/open-api-renderer](https://github.com/temando/open-api-renderer)| React.js| A React renderer for OpenAPI v3 |
| WebSphere Liberty | [Download jar](https://developer.ibm.com/wasdev/downloads/) | JavaScript | Includes a native OpenAPI v3 UI which allows for customization of its banners and URL |
| Widdershins | [github/Mermade/widdershins](https://github.com/Mermade/widdershins) | Node.js | Generate Slate/Shins markdown from OpenAPI 3.0.x |
| angular-swagger-ui | [github/angular-swagger-ui](https://github.com/Orange-OpenSource/angular-swagger-ui) | AngularJS | An angularJS implementation of Swagger UI |
| Redoc | [github/Redocly/redoc](https://github.com/Redocly/redoc) | JavaScript | A React-based renderer with deep support for OAS v2 and v3 and zero dev-dependency|
#### Mock Servers
| Title | Project Link | Language | Description |
| -------------- | ------------ | -------- | ----------- |
| API Sprout | [github/danielgtaylor/apisprout](https://github.com/danielgtaylor/apisprout) | Go | Lightweight, blazing fast, cross-platform OpenAPI 3 mock server with validation |
#### Server Implementations
| Title | Project Link | Language |Description |
|----------------|--------------|----------|---------------------|
| Vert.x Web API Contract | [github/vert-x3/vertx-web](http://vertx.io/docs/#web) | Java, Kotlin, JavaScript, Groovy, Ruby, Ceylon & Scala | Create an API endpoint with Vert.x 3 and OpenAPI 3 with automatic requests validation
| Fusio | [github/apioo/fusio](https://github.com/apioo/fusio) | PHP, JavaScript | Build API endpoints based on OpenAPI 3
| Modern | [github/modern-project/modern-ruby](https://github.com/modern-project/modern-ruby) | Ruby | OpenAPI 3-based Rack framework with automatic OAS generation and requests/response validation
| Koa2-OAS3 | [github/OverSpeedIO/koa2-oas3](https://github.com/OverSpeedIO/koa2-oas3) | Node.js | OpenAPI 3 request validation middleware for Koa2 based apps.
| Exegesis | [github/exegesis-js/exegesis](https://github.com/exegesis-js/exegesis) | Node.js | OpenAPI 3 server-side framework for express and other frameworks.
| PHP-CRUD-API | [github/mevdschee/php-crud-api](https://github.com/mevdschee/php-crud-api) | PHP | Automatic CRUD API with OpenAPI 3 docs
| FastAPI | [github/tiangolo/fastapi](https://github.com/tiangolo/fastapi) | Python | OpenAPI 3 based, high performance, Python 3.6+ API framework with automatic data validation, serialization and great editor support.
| Fastify OpenAPI v3 | [gitlab.com/m03geek/fastify-oas](https://gitlab.com/m03geek/fastify-oas) | Node.JS | Fastify OpenAPI v3+ plugin. Generates OpenAPI specification from fastify schemas and routes. Also serves swagger ui and spec in json/yaml formats.
| openapi-backend | [github/anttiviljami/openapi-backend](https://github.com/anttiviljami/openapi-backend) | Node.js, TypeScript | Build, Validate, Route, and Mock in the backend using OpenAPI v3 spec in your favourite framework
#### Client Implementations
| Title | Project Link | Language | Description |
|----------------|--------------|----------|-------------|
| Scorpio | [github/notEthan/scorpio](https://github.com/notEthan/Scorpio) | Ruby | OpenAPI 2 and 3 implementation offering a HTTP client library |
| openapi-client-axios | [github/anttiviljami/openapi-client-axios](https://github.com/anttiviljami/openapi-client-axios) | JavaScript, TypeScript | JavaScript client library for consuming OpenAPI-enabled APIs with axios. Types included.
#### 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. |
| Gen | [github/wzshiming/gen](https://github.com/wzshiming/gen) | Go | Generate OpenAPI 3, client, and route based on golang source code. |
| serverless-openapi-documentation | [github/temando/serverless-openapi-documentation](https://github.com/temando/serverless-openapi-documentation) | TypeScript | Serverless 1.0 plugin to generate OpenAPI V3 documentation from serverless configuration |
| zero-rails_openapi | [github/zhandao/zero-rails_openapi](https://github.com/zhandao/zero-rails_openapi) | Ruby | Provide concise DSL for generating the OpenAPI Specification 3 documentation file for Rails application |
| slush-vertx | [github/pmlopes/slush-vertx](https://github.com/pmlopes/slush-vertx) | Java, Kotlin & Groovy | Generate server skeleton for [Vert.x Web API Contract](http://vertx.io/docs/#web) and API Client based on [Vert.x 3 Web Client](http://vertx.io/docs/#web)
| WebSphere Liberty | [Download jar](https://developer.ibm.com/wasdev/downloads/) | Java EE | Generates OpenAPI v3 documentation from Java EE applications |
| swagger-node-codegen | [github/fmvilas/swagger-node-codegen](https://github.com/fmvilas/swagger-node-codegen) | Node.js | Generates a Node.js/express server, but also has a template engine for creating any templates needed. |
.NET-C#-Annotations | [github/Microsoft/OpenAPI-NET-CSharpAnnotations](https://github.com/Microsoft/OpenAPI.NET.CSharpAnnotations) | dotnet | Convert your native C# comments/annotation XML from your API code into a OpenAPI document object. |
| Object Oriented OpenAPI Specification | [github/goldspecdigital/oooas](https://github.com/goldspecdigital/oooas) | PHP | Generates OpenAPI documents using PHP. |
OpenAPI-Specification-3.1.0/LICENSE 0000664 0000000 0000000 00000026121 14013016525 0016530 0 ustar 00root root 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
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.
OpenAPI-Specification-3.1.0/MAINTAINERS.md 0000664 0000000 0000000 00000000741 14013016525 0017617 0 ustar 00root root 0000000 0000000 ## Active
* Darrel Miller [@darrelmiller](https://github.com/darrelmiller)
* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc)
* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh)
* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson)
* Ron Ratovsky [@webron](https://github.com/webron)
* Uri Sarid [@usarid](https://github.com/usarid)
## Emeritus
* Jason Harmon [@jharmn](https://github.com/jharmn)
* Tony Tam [@fehguy](https://github.com/fehguy)
OpenAPI-Specification-3.1.0/README.md 0000664 0000000 0000000 00000012265 14013016525 0017006 0 ustar 00root root 0000000 0000000 # The OpenAPI Specification


The OpenAPI Specification is a community-driven open specification within the [OpenAPI Initiative](https://www.openapis.org/), a Linux Foundation Collaborative Project.
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.
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 APIs 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 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 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 a HTTP API.
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.
## 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 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).
## 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 implementations](IMPLEMENTATIONS.md).
## Participation
The current process for development of the OpenAPI Specification is described in
[Development Guidelines](DEVELOPMENT.md).
Development of 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 master.
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 [TSC calendar online](https://openapi.groups.io/g/tsc/calendar), and import it to your calendar using the [iCal link](https://openapi.groups.io/g/tsc/ics/1105671/1995679554/feed.ics).
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.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 subscribing to the existing issue or PR.
* 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.
## Licensing
See: [License (Apache-2.0)](https://github.com/OAI/OpenAPI-Specification/blob/master/LICENSE)

OpenAPI-Specification-3.1.0/TOB.md 0000664 0000000 0000000 00000001022 14013016525 0016462 0 ustar 00root root 0000000 0000000 # 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 2021
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
OpenAPI-Specification-3.1.0/examples/ 0000775 0000000 0000000 00000000000 14013016525 0017337 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/ 0000775 0000000 0000000 00000000000 14013016525 0020024 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/json/ 0000775 0000000 0000000 00000000000 14013016525 0020775 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/json/api-with-examples.json 0000664 0000000 0000000 00000011722 14013016525 0025231 0 ustar 00root root 0000000 0000000 {
"swagger": "2.0",
"info": {
"title": "Simple API overview",
"version": "v2"
},
"paths": {
"/": {
"get": {
"operationId": "listVersionsv2",
"summary": "List API versions",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 300 response",
"examples": {
"application/json": "{\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}"
}
},
"300": {
"description": "200 300 response",
"examples": {
"application/json": "{\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}"
}
}
}
}
},
"/v2": {
"get": {
"operationId": "getVersionDetailsv2",
"summary": "Show API version details",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 203 response",
"examples": {
"application/json": "{\n \"version\": {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"media-types\": [\n {\n \"base\": \"application/xml\",\n \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n },\n {\n \"base\": \"application/json\",\n \"type\": \"application/vnd.openstack.compute+json;version=2\"\n }\n ],\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v2/\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n \"type\": \"application/pdf\",\n \"rel\": \"describedby\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n \"type\": \"application/vnd.sun.wadl+xml\",\n \"rel\": \"describedby\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n \"type\": \"application/vnd.sun.wadl+xml\",\n \"rel\": \"describedby\"\n }\n ]\n }\n}"
}
},
"203": {
"description": "200 203 response",
"examples": {
"application/json": "{\n \"version\": {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"media-types\": [\n {\n \"base\": \"application/xml\",\n \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n },\n {\n \"base\": \"application/json\",\n \"type\": \"application/vnd.openstack.compute+json;version=2\"\n }\n ],\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://23.253.228.211:8774/v2/\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n \"type\": \"application/pdf\",\n \"rel\": \"describedby\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n \"type\": \"application/vnd.sun.wadl+xml\",\n \"rel\": \"describedby\"\n }\n ]\n }\n}"
}
}
}
}
}
},
"consumes": [
"application/json"
]
} OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-expanded.json 0000664 0000000 0000000 00000014451 14013016525 0025330 0 ustar 00root root 0000000 0000000 {
"swagger": "2.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",
"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"
}
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"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,
"type": "array",
"collectionFormat": "csv",
"items": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"description": "maximum number of results to return",
"required": false,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"description": "Creates a new pet in the store. Duplicates are allowed",
"operationId": "addPet",
"parameters": [
{
"name": "pet",
"in": "body",
"description": "Pet to add to the store",
"required": true,
"schema": {
"$ref": "#/definitions/NewPet"
}
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/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,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/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,
"type": "integer",
"format": "int64"
}
],
"responses": {
"204": {
"description": "pet deleted"
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Pet": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/NewPet"
},
{
"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"
}
}
}
}
}
OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-minimal.json 0000664 0000000 0000000 00000002533 14013016525 0025164 0 ustar 00root root 0000000 0000000 {
"swagger": "2.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",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Swagger API Team"
},
"license": {
"name": "MIT"
}
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/pets": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A list of pets.",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
}
}
}
}
},
"definitions": {
"Pet": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/ 0000775 0000000 0000000 00000000000 14013016525 0024444 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/common/ 0000775 0000000 0000000 00000000000 14013016525 0025734 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/common/Error.json 0000664 0000000 0000000 00000000320 14013016525 0027713 0 ustar 00root root 0000000 0000000 {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
} OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/spec/ 0000775 0000000 0000000 00000000000 14013016525 0025376 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/spec/NewPet.json 0000664 0000000 0000000 00000000400 14013016525 0027465 0 ustar 00root root 0000000 0000000 {
"type": "object",
"allOf": [
{
"$ref": "Pet.json"
},
{
"required": [
"name"
],
"properties": {
"description": {
"type": "integer",
"format": "int64"
}
}
}
]
} OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/spec/Pet.json 0000664 0000000 0000000 00000000361 14013016525 0027021 0 ustar 00root root 0000000 0000000 {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
} OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/spec/parameters.json 0000664 0000000 0000000 00000000634 14013016525 0030437 0 ustar 00root root 0000000 0000000 {
"tagsParam": {
"name": "tags",
"in": "query",
"description": "tags to filter by",
"required": false,
"type": "array",
"collectionFormat": "csv",
"items": {
"type": "string"
}
},
"limitsParam": {
"name": "limit",
"in": "query",
"description": "maximum number of results to return",
"required": false,
"type": "integer",
"format": "int32"
}
} OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-separate/spec/swagger.json 0000664 0000000 0000000 00000012032 14013016525 0027726 0 ustar 00root root 0000000 0000000 {
"swagger": "2.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",
"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"
}
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"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": [
{
"$ref": "parameters.json#/tagsParam"
},
{
"$ref": "parameters.json#/limitsParam"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"type": "array",
"items": {
"$ref": "Pet.json"
}
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "../common/Error.json"
}
}
}
},
"post": {
"description": "Creates a new pet in the store. Duplicates are allowed",
"operationId": "addPet",
"parameters": [
{
"name": "pet",
"in": "body",
"description": "Pet to add to the store",
"required": true,
"schema": {
"$ref": "NewPet.json"
}
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "Pet.json"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "../common/Error.json"
}
}
}
}
},
"/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,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "Pet.json"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "../common/Error.json"
}
}
}
},
"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,
"type": "integer",
"format": "int64"
}
],
"responses": {
"204": {
"description": "pet deleted"
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "../common/Error.json"
}
}
}
}
}
}
}
OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-simple.json 0000664 0000000 0000000 00000012105 14013016525 0025023 0 ustar 00root root 0000000 0000000 {
"swagger": "2.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",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Swagger API Team"
},
"license": {
"name": "MIT"
}
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/pets": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"operationId": "findPets",
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"parameters": [
{
"name": "tags",
"in": "query",
"description": "tags to filter by",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
},
{
"name": "limit",
"in": "query",
"description": "maximum number of results to return",
"required": false,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
},
"post": {
"description": "Creates a new pet in the store. Duplicates are allowed",
"operationId": "addPet",
"produces": [
"application/json"
],
"parameters": [
{
"name": "pet",
"in": "body",
"description": "Pet to add to the store",
"required": true,
"schema": {
"$ref": "#/definitions/NewPet"
}
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
}
},
"/pets/{id}": {
"get": {
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"operationId": "findPetById",
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of pet to fetch",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
},
"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,
"type": "integer",
"format": "int64"
}
],
"responses": {
"204": {
"description": "pet deleted"
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
}
}
},
"definitions": {
"Pet": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/NewPet"
},
{
"required": [
"id"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
}
}
}
]
},
"NewPet": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"ErrorModel": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore-with-external-docs.json 0000664 0000000 0000000 00000012677 14013016525 0027271 0 ustar 00root root 0000000 0000000 {
"swagger": "2.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",
"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"
}
},
"externalDocs": {
"description": "find more info here",
"url": "https://swagger.io/about"
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/pets": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"operationId": "findPets",
"externalDocs": {
"description": "find more info here",
"url": "https://swagger.io/about"
},
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"parameters": [
{
"name": "tags",
"in": "query",
"description": "tags to filter by",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
},
{
"name": "limit",
"in": "query",
"description": "maximum number of results to return",
"required": false,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
},
"post": {
"description": "Creates a new pet in the store. Duplicates are allowed",
"operationId": "addPet",
"produces": [
"application/json"
],
"parameters": [
{
"name": "pet",
"in": "body",
"description": "Pet to add to the store",
"required": true,
"schema": {
"$ref": "#/definitions/NewPet"
}
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
}
},
"/pets/{id}": {
"get": {
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"operationId": "findPetById",
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "ID of pet to fetch",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
},
"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,
"type": "integer",
"format": "int64"
}
],
"responses": {
"204": {
"description": "pet deleted"
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
}
}
},
"definitions": {
"Pet": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/NewPet"
},
{
"required": [
"id"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
}
}
}
]
},
"NewPet": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"ErrorModel": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}
OpenAPI-Specification-3.1.0/examples/v2.0/json/petstore.json 0000664 0000000 0000000 00000006225 14013016525 0023542 0 ustar 00root root 0000000 0000000 {
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
"license": {
"name": "MIT"
}
},
"host": "petstore.swagger.io",
"basePath": "/v1",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"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,
"type": "integer",
"format": "int32"
}
],
"responses": {
"200": {
"description": "An paged array of pets",
"headers": {
"x-next": {
"type": "string",
"description": "A link to the next page of responses"
}
},
"schema": {
"$ref": "#/definitions/Pets"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"summary": "Create a pet",
"operationId": "createPets",
"tags": [
"pets"
],
"responses": {
"201": {
"description": "Null response"
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/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",
"type": "string"
}
],
"responses": {
"200": {
"description": "Expected response to a valid request",
"schema": {
"$ref": "#/definitions/Pets"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Pet": {
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"Pets": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
},
"Error": {
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v2.0/json/uber.json 0000664 0000000 0000000 00000026637 14013016525 0022643 0 ustar 00root root 0000000 0000000 {
"swagger": "2.0",
"info": {
"title": "Uber API",
"description": "Move your app forward with the Uber API",
"version": "1.0.0"
},
"host": "api.uber.com",
"schemes": [
"https"
],
"basePath": "/v1",
"produces": [
"application/json"
],
"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,
"type": "number",
"format": "double"
},
{
"name": "longitude",
"in": "query",
"description": "Longitude component of location.",
"required": true,
"type": "number",
"format": "double"
}
],
"tags": [
"Products"
],
"responses": {
"200": {
"description": "An array of products",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Product"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/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,
"type": "number",
"format": "double"
},
{
"name": "start_longitude",
"in": "query",
"description": "Longitude component of start location.",
"required": true,
"type": "number",
"format": "double"
},
{
"name": "end_latitude",
"in": "query",
"description": "Latitude component of end location.",
"required": true,
"type": "number",
"format": "double"
},
{
"name": "end_longitude",
"in": "query",
"description": "Longitude component of end location.",
"required": true,
"type": "number",
"format": "double"
}
],
"tags": [
"Estimates"
],
"responses": {
"200": {
"description": "An array of price estimates by product",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/PriceEstimate"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/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,
"type": "number",
"format": "double"
},
{
"name": "start_longitude",
"in": "query",
"description": "Longitude component of start location.",
"required": true,
"type": "number",
"format": "double"
},
{
"name": "customer_uuid",
"in": "query",
"type": "string",
"format": "uuid",
"description": "Unique customer identifier to be used for experience customization."
},
{
"name": "product_id",
"in": "query",
"type": "string",
"description": "Unique identifier representing a specific product for a given latitude & longitude."
}
],
"tags": [
"Estimates"
],
"responses": {
"200": {
"description": "An array of products",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Product"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/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",
"schema": {
"$ref": "#/definitions/Profile"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/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",
"type": "integer",
"format": "int32",
"description": "Offset the list of returned results by this amount. Default is zero."
},
{
"name": "limit",
"in": "query",
"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",
"schema": {
"$ref": "#/definitions/Activities"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"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": "string",
"description": "Capacity of product. For example, 4 people."
},
"image": {
"type": "string",
"description": "Image URL representing the 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": "#/definitions/Activity"
}
}
}
},
"Error": {
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"fields": {
"type": "string"
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v2.0/yaml/ 0000775 0000000 0000000 00000000000 14013016525 0020766 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/yaml/api-with-examples.yaml 0000664 0000000 0000000 00000013727 14013016525 0025222 0 ustar 00root root 0000000 0000000 swagger: "2.0"
info:
title: Simple API overview
version: v2
paths:
/:
get:
operationId: listVersionsv2
summary: List API versions
produces:
- application/json
responses:
"200":
description: |-
200 300 response
examples:
application/json: |-
{
"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: |-
200 300 response
examples:
application/json: |-
{
"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"
}
]
}
]
}
/v2:
get:
operationId: getVersionDetailsv2
summary: Show API version details
produces:
- application/json
responses:
"200":
description: |-
200 203 response
examples:
application/json: |-
{
"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: |-
200 203 response
examples:
application/json: |-
{
"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"
}
]
}
}
consumes:
- application/json
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-expanded.yaml 0000664 0000000 0000000 00000006576 14013016525 0025323 0 ustar 00root root 0000000 0000000 swagger: "2.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
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
host: petstore.swagger.io
basePath: /api
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/pets:
get:
description: |
Returns all pets from the system that the user has access to
operationId: findPets
parameters:
- name: tags
in: query
description: tags to filter by
required: false
type: array
collectionFormat: csv
items:
type: string
- name: limit
in: query
description: maximum number of results to return
required: false
type: integer
format: int32
responses:
"200":
description: pet response
schema:
type: array
items:
$ref: '#/definitions/Pet'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
post:
description: Creates a new pet in the store. Duplicates are allowed
operationId: addPet
parameters:
- name: pet
in: body
description: Pet to add to the store
required: true
schema:
$ref: '#/definitions/NewPet'
responses:
"200":
description: pet response
schema:
$ref: '#/definitions/Pet'
default:
description: unexpected error
schema:
$ref: '#/definitions/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
type: integer
format: int64
responses:
"200":
description: pet response
schema:
$ref: '#/definitions/Pet'
default:
description: unexpected error
schema:
$ref: '#/definitions/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
type: integer
format: int64
responses:
"204":
description: pet deleted
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
Pet:
allOf:
- $ref: '#/definitions/NewPet'
- required:
- id
type: "object"
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
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-minimal.yaml 0000664 0000000 0000000 00000002114 14013016525 0025141 0 ustar 00root root 0000000 0000000 ---
swagger: "2.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"
termsOfService: "http://swagger.io/terms/"
contact:
name: "Swagger API Team"
license:
name: "MIT"
host: "petstore.swagger.io"
basePath: "/api"
schemes:
- "http"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/pets:
get:
description: "Returns all pets from the system that the user has access to"
produces:
- "application/json"
responses:
"200":
description: "A list of pets."
schema:
type: "array"
items:
$ref: "#/definitions/Pet"
definitions:
Pet:
type: "object"
required:
- "id"
- "name"
properties:
id:
type: "integer"
format: "int64"
name:
type: "string"
tag:
type: "string"
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/ 0000775 0000000 0000000 00000000000 14013016525 0024435 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/common/ 0000775 0000000 0000000 00000000000 14013016525 0025725 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/common/Error.yaml 0000664 0000000 0000000 00000000200 14013016525 0027672 0 ustar 00root root 0000000 0000000 type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/spec/ 0000775 0000000 0000000 00000000000 14013016525 0025367 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/spec/NewPet.yaml 0000664 0000000 0000000 00000000223 14013016525 0027452 0 ustar 00root root 0000000 0000000 type: object
allOf:
- $ref: 'Pet.yaml'
- required:
- name
properties:
description:
type: integer
format: int64
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/spec/Pet.yaml 0000664 0000000 0000000 00000000216 14013016525 0027002 0 ustar 00root root 0000000 0000000 type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/spec/parameters.yaml 0000664 0000000 0000000 00000000443 14013016525 0030417 0 ustar 00root root 0000000 0000000 tagsParam:
name: tags
in: query
description: tags to filter by
required: false
type: array
collectionFormat: csv
items:
type: string
limitsParam:
name: limit
in: query
description: maximum number of results to return
required: false
type: integer
format: int32
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml 0000664 0000000 0000000 00000007756 14013016525 0027731 0 ustar 00root root 0000000 0000000 swagger: "2.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
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
host: petstore.swagger.io
basePath: /api
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/pets:
get:
description: |
Returns all pets from the system that the user has access to
Nam 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.
Sed 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.
operationId: findPets
parameters:
- $ref: 'parameters.yaml#/tagsParam'
- $ref: 'parameters.yaml#/limitsParam'
responses:
"200":
description: pet response
schema:
type: array
items:
$ref: 'Pet.yaml'
default:
description: unexpected error
schema:
$ref: '../common/Error.yaml'
post:
description: Creates a new pet in the store. Duplicates are allowed
operationId: addPet
parameters:
- name: pet
in: body
description: Pet to add to the store
required: true
schema:
$ref: 'NewPet.yaml'
responses:
"200":
description: pet response
schema:
$ref: 'Pet.yaml'
default:
description: unexpected error
schema:
$ref: '../common/Error.yaml'
/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
type: integer
format: int64
responses:
"200":
description: pet response
schema:
$ref: 'Pet.yaml'
default:
description: unexpected error
schema:
$ref: '../common/Error.yaml'
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
type: integer
format: int64
responses:
"204":
description: pet deleted
default:
description: unexpected error
schema:
$ref: '../common/Error.yaml'
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-simple.yaml 0000664 0000000 0000000 00000010123 14013016525 0025003 0 ustar 00root root 0000000 0000000 ---
swagger: "2.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"
termsOfService: "http://swagger.io/terms/"
contact:
name: "Swagger API Team"
license:
name: "MIT"
host: "petstore.swagger.io"
basePath: "/api"
schemes:
- "http"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/pets:
get:
description: "Returns all pets from the system that the user has access to"
operationId: "findPets"
produces:
- "application/json"
- "application/xml"
- "text/xml"
- "text/html"
parameters:
-
name: "tags"
in: "query"
description: "tags to filter by"
required: false
type: "array"
items:
type: "string"
collectionFormat: "csv"
-
name: "limit"
in: "query"
description: "maximum number of results to return"
required: false
type: "integer"
format: "int32"
responses:
"200":
description: "pet response"
schema:
type: "array"
items:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
post:
description: "Creates a new pet in the store. Duplicates are allowed"
operationId: "addPet"
produces:
- "application/json"
parameters:
-
name: "pet"
in: "body"
description: "Pet to add to the store"
required: true
schema:
$ref: "#/definitions/NewPet"
responses:
"200":
description: "pet response"
schema:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
/pets/{id}:
get:
description: "Returns a user based on a single ID, if the user does not have access to the pet"
operationId: "findPetById"
produces:
- "application/json"
- "application/xml"
- "text/xml"
- "text/html"
parameters:
-
name: "id"
in: "path"
description: "ID of pet to fetch"
required: true
type: "integer"
format: "int64"
responses:
"200":
description: "pet response"
schema:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
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
type: "integer"
format: "int64"
responses:
"204":
description: "pet deleted"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
definitions:
Pet:
type: "object"
allOf:
-
$ref: "#/definitions/NewPet"
-
required:
- "id"
properties:
id:
type: "integer"
format: "int64"
NewPet:
type: "object"
required:
- "name"
properties:
name:
type: "string"
tag:
type: "string"
ErrorModel:
type: "object"
required:
- "code"
- "message"
properties:
code:
type: "integer"
format: "int32"
message:
type: "string"
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore-with-external-docs.yaml 0000664 0000000 0000000 00000010643 14013016525 0027242 0 ustar 00root root 0000000 0000000 ---
swagger: "2.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"
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"
externalDocs:
description: "find more info here"
url: "https://swagger.io/about"
host: "petstore.swagger.io"
basePath: "/api"
schemes:
- "http"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/pets:
get:
description: "Returns all pets from the system that the user has access to"
operationId: "findPets"
externalDocs:
description: "find more info here"
url: "https://swagger.io/about"
produces:
- "application/json"
- "application/xml"
- "text/xml"
- "text/html"
parameters:
-
name: "tags"
in: "query"
description: "tags to filter by"
required: false
type: "array"
items:
type: "string"
collectionFormat: "csv"
-
name: "limit"
in: "query"
description: "maximum number of results to return"
required: false
type: "integer"
format: "int32"
responses:
"200":
description: "pet response"
schema:
type: "array"
items:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
post:
description: "Creates a new pet in the store. Duplicates are allowed"
operationId: "addPet"
produces:
- "application/json"
parameters:
-
name: "pet"
in: "body"
description: "Pet to add to the store"
required: true
schema:
$ref: "#/definitions/NewPet"
responses:
"200":
description: "pet response"
schema:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
/pets/{id}:
get:
description: "Returns a user based on a single ID, if the user does not have access to the pet"
operationId: "findPetById"
produces:
- "application/json"
- "application/xml"
- "text/xml"
- "text/html"
parameters:
-
name: "id"
in: "path"
description: "ID of pet to fetch"
required: true
type: "integer"
format: "int64"
responses:
"200":
description: "pet response"
schema:
$ref: "#/definitions/Pet"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
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
type: "integer"
format: "int64"
responses:
"204":
description: "pet deleted"
default:
description: "unexpected error"
schema:
$ref: "#/definitions/ErrorModel"
definitions:
Pet:
type: "object"
allOf:
-
$ref: "#/definitions/NewPet"
-
required:
- "id"
properties:
id:
type: "integer"
format: "int64"
NewPet:
type: "object"
required:
- "name"
properties:
name:
type: "string"
tag:
type: "string"
ErrorModel:
type: "object"
required:
- "code"
- "message"
properties:
code:
type: "integer"
format: "int32"
message:
type: "string"
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/petstore.yaml 0000664 0000000 0000000 00000004211 14013016525 0023515 0 ustar 00root root 0000000 0000000 swagger: "2.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
host: petstore.swagger.io
basePath: /v1
schemes:
- http
consumes:
- application/json
produces:
- application/json
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
type: integer
format: int32
responses:
"200":
description: A paged array of pets
headers:
x-next:
type: string
description: A link to the next page of responses
schema:
$ref: '#/definitions/Pets'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Create a pet
operationId: createPets
tags:
- pets
responses:
"201":
description: Null response
default:
description: unexpected error
schema:
$ref: '#/definitions/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
type: string
responses:
"200":
description: Expected response to a valid request
schema:
$ref: '#/definitions/Pets'
default:
description: unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
Pet:
type: "object"
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
Pets:
type: array
items:
$ref: '#/definitions/Pet'
Error:
type: "object"
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
OpenAPI-Specification-3.1.0/examples/v2.0/yaml/uber.yaml 0000664 0000000 0000000 00000022263 14013016525 0022614 0 ustar 00root root 0000000 0000000 # this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: "2.0"
info:
title: Uber API
description: Move your app forward with the Uber API
version: "1.0.0"
# the domain of the service
host: api.uber.com
# array of all schemes that your API supports
schemes:
- https
# will be prefixed to all paths
basePath: /v1
securityDefinitions:
apikey:
type: apiKey
name: server_token
in: query
produces:
- application/json
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
type: number
format: double
- name: longitude
in: query
description: Longitude component of location.
required: true
type: number
format: double
security:
- apikey: []
tags:
- Products
responses:
"200":
description: An array of products
schema:
type: array
items:
$ref: '#/definitions/Product'
default:
description: Unexpected error
schema:
$ref: '#/definitions/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
type: number
format: double
- name: start_longitude
in: query
description: Longitude component of start location.
required: true
type: number
format: double
- name: end_latitude
in: query
description: Latitude component of end location.
required: true
type: number
format: double
- name: end_longitude
in: query
description: Longitude component of end location.
required: true
type: number
format: double
tags:
- Estimates
responses:
"200":
description: An array of price estimates by product
schema:
type: array
items:
$ref: '#/definitions/PriceEstimate'
default:
description: Unexpected error
schema:
$ref: '#/definitions/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
type: number
format: double
- name: start_longitude
in: query
description: Longitude component of start location.
required: true
type: number
format: double
- name: customer_uuid
in: query
type: string
format: uuid
description: Unique customer identifier to be used for experience customization.
- name: product_id
in: query
type: string
description: Unique identifier representing a specific product for a given latitude & longitude.
tags:
- Estimates
responses:
"200":
description: An array of products
schema:
type: array
items:
$ref: '#/definitions/Product'
default:
description: Unexpected error
schema:
$ref: '#/definitions/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
schema:
$ref: '#/definitions/Profile'
default:
description: Unexpected error
schema:
$ref: '#/definitions/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
type: integer
format: int32
description: Offset the list of returned results by this amount. Default is zero.
- name: limit
in: query
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
schema:
$ref: '#/definitions/Activities'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
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: "#/definitions/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: '#/definitions/Activity'
Error:
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string
OpenAPI-Specification-3.1.0/examples/v3.0/ 0000775 0000000 0000000 00000000000 14013016525 0020025 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v3.0/api-with-examples.json 0000664 0000000 0000000 00000014427 14013016525 0024266 0 ustar 00root root 0000000 0000000 {
"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"
}
]
}
}
}
}
}
}
}
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v3.0/api-with-examples.yaml 0000664 0000000 0000000 00000014454 14013016525 0024257 0 ustar 00root root 0000000 0000000 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: |
{
"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"
}
]
}
]
}
/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"
}
]
}
}
OpenAPI-Specification-3.1.0/examples/v3.0/callback-example.json 0000664 0000000 0000000 00000005150 14013016525 0024106 0 ustar 00root root 0000000 0000000 {
"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"
}
}
}
}
}
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v3.0/callback-example.yaml 0000664 0000000 0000000 00000004156 14013016525 0024104 0 ustar 00root root 0000000 0000000 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
by the source server
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:
# the name `onData` is a convenience locator
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':
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
if the data was received successfully
'204':
description: |
Your server should return this HTTP status code if no longer interested
in further updates
OpenAPI-Specification-3.1.0/examples/v3.0/link-example.json 0000664 0000000 0000000 00000017105 14013016525 0023312 0 ustar 00root root 0000000 0000000 {
"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"
}
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v3.0/link-example.yaml 0000664 0000000 0000000 00000012240 14013016525 0023276 0 ustar 00root root 0000000 0000000 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:
# returns array of '#/components/schemas/repository'
operationId: getRepositoriesByOwner
parameters:
username: $response.body#/username
UserRepository:
# returns '#/components/schemas/repository'
operationId: getRepository
parameters:
username: $response.body#/owner/username
slug: $response.body#/slug
RepositoryPullRequests:
# returns '#/components/schemas/pullrequest'
operationId: getPullRequestsByRepository
parameters:
username: $response.body#/owner/username
slug: $response.body#/slug
PullRequestMerge:
# executes /2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge
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'
OpenAPI-Specification-3.1.0/examples/v3.0/petstore-expanded.json 0000664 0000000 0000000 00000016414 14013016525 0024361 0 ustar 00root root 0000000 0000000 {
"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": "http://petstore.swagger.io/api"
}
],
"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"
}
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v3.0/petstore-expanded.yaml 0000664 0000000 0000000 00000012547 14013016525 0024355 0 ustar 00root root 0000000 0000000 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: http://petstore.swagger.io/api
paths:
/pets:
get:
description: |
Returns all pets from the system that the user has access to
Nam 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.
Sed 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.
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
OpenAPI-Specification-3.1.0/examples/v3.0/petstore.json 0000664 0000000 0000000 00000007574 14013016525 0022602 0 ustar 00root root 0000000 0000000 {
"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",
"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"
],
"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",
"items": {
"$ref": "#/components/schemas/Pet"
}
},
"Error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v3.0/petstore.yaml 0000664 0000000 0000000 00000005015 14013016525 0022557 0 ustar 00root root 0000000 0000000 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
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
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
items:
$ref: "#/components/schemas/Pet"
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
OpenAPI-Specification-3.1.0/examples/v3.0/uspto.json 0000664 0000000 0000000 00000021742 14013016525 0022100 0 ustar 00root root 0000000 0000000 {
"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"
}
}
}
}
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v3.0/uspto.yaml 0000664 0000000 0000000 00000017077 14013016525 0022077 0 ustar 00root root 0000000 0000000 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
OpenAPI-Specification-3.1.0/examples/v3.1/ 0000775 0000000 0000000 00000000000 14013016525 0020026 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/examples/v3.1/webhook-example.json 0000664 0000000 0000000 00000001741 14013016525 0024013 0 ustar 00root root 0000000 0000000 {
"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"
}
}
}
}
}
} OpenAPI-Specification-3.1.0/examples/v3.1/webhook-example.yaml 0000664 0000000 0000000 00000001642 14013016525 0024004 0 ustar 00root root 0000000 0000000 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
OpenAPI-Specification-3.1.0/guidelines/ 0000775 0000000 0000000 00000000000 14013016525 0017651 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/guidelines/EXTENSIONS.md 0000664 0000000 0000000 00000000133 14013016525 0021667 0 ustar 00root root 0000000 0000000 For OpenAPI Specification version 2.0, please see [v2.0/EXTENSIONS.md](v2.0/EXTENSIONS.md)
OpenAPI-Specification-3.1.0/guidelines/v2.0/ 0000775 0000000 0000000 00000000000 14013016525 0020336 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/guidelines/v2.0/EXTENSIONS.md 0000664 0000000 0000000 00000006237 14013016525 0022367 0 ustar 00root root 0000000 0000000 # OpenAPI Extensions
The OpenAPI Specification version 2.0 allows for custom properties to be added at several places within an OpenAPI document., allowing
API providers to extend the meta-data provided for their REST APIs as needed. Extension properties are always
prefixed by "x-" and can have any valid JSON format value.
Currently extension properties are supported in the following definition objects:
* within the [info object](/versions/2.0.md#info-object)
* within the [paths object](/versions/2.0.md#paths-object)
* within the [path-item object](/versions/2.0.md#path-item-object)
* within the [operation object](/versions/2.0.md#operationObject)
* within the [parameter object](/versions/2.0.md#parameterObject)
* within the [responses object](/versions/2.0.md#responses-object)
* within the [tag object](/versions/2.0.md#tag-object)
* within the [security-scheme object](/versions/2.0.md#security-scheme-object)
For example, a vendor extension that adds apis.json specific metadata to an OpenAPI definition might look as follows:
```json
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "Analysis",
"description" : "Provides access to blog posts and analysis across the API Evangelist network.",
"x-apis-json" : {
"image": "https://s3.amazonaws.com/kinlane-productions/api-evangelist/t-shirts/KL_InApiWeTrust-1000.png",
"humanURL": "http://developer.apievangelist.com",
"baseURL": "http://api.apievangelist.com/definitions/Analysis",
"tags": [
"blog",
"industry",
"analysis",
"new",
"API",
"Application Programming Interface"
],
"properties": [
{
"type": "X-signup",
"url": "https://apievangelist.3scale.net/"
},
{
"type": "X-blog",
"url": "http://developer.apievangelist.com/blog/"
},
{
"type": "X-apicommonsmanifest",
"url": "https://raw.githubusercontent.com/kinlane/analysis-api/master/api-commons-manifest.json"
}
],
}
},
"basePath": "/",
"paths": {
...
}
}
```
This could be used by corresponding tooling that builds apis.json files for OpenAPI definitions, the advantage being that all metadata
for the API is within one definition instead of spread out amongst multiple files.
Another (simplified) example could be how to specify a [JWE encryption](http://hdknr.github.io/docs/identity/jwe.html) policy to parameters,
for example as follows:
```json
{
...
"socialSecurityNumber": {
"name": "socialSecurityNumber",
"in": "query",
"description": "a social security number",
"required": false,
"type": "string",
"x-jwe-encryption" : {
"algorithm" : "RSA-OAEP",
"encryption" : "A256GCM"
}
}
}
...
}
```
An API consumer reading these parameter definitions could interpret this as having to encrypt the skip parameter in line
with the JWE standard.
## Annotations
The OpenAPI-specific annotations currently available for jax-rs APIs do not support the addition of extension data.
OpenAPI-Specification-3.1.0/guidelines/v2.0/README.md 0000664 0000000 0000000 00000000230 14013016525 0021610 0 ustar 00root root 0000000 0000000 ## Guidelines for OpenAPI Definitions
* [Reuse](REUSE.md) of OpenAPI definitions
* [Extending](EXTENSIONS.md) OpenAPI definitions with custom metadata
OpenAPI-Specification-3.1.0/guidelines/v2.0/REUSE.md 0000664 0000000 0000000 00000022616 14013016525 0021552 0 ustar 00root root 0000000 0000000 # Reuse Philosophy
We encourage reuse and patterns through references.
## What is reusable
The following types are reusable, as defined by the spec:
* Parameters
* Models (_or Schema Objects in general_)
* Responses
* Operations (_Operations can only be remote references_)
## Reuse strategy
When authoring API design documents, common object definitions can be utilized to avoid duplication. For example, imagine multiple path definitions that each share a common path parameter, or a common response structure. The OpenAPI specification allows reuse of common object definitions through the use of "references".
A reference is a construct in your API design document that indicates "the content for this portion of the document is defined elsewhere". To create a reference, at the location in your document where you want to reuse some other definition, create an object that has a `$ref` property whose value is a URI pointing to where the definition is (more on this in later sections).
OpenAPI's provides reference capabilities using the [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) specification.
### JSON Example
``` js
{
// ...
definitions: {
Person: {
type: 'object',
properties: {
friends: {
type: 'array',
items: {
$ref: '#/definitions/Person'
}
}
}
}
}
}
```
### YAML Example
``` yaml
# ...
definitions:
Person:
type: object
properties:
friends:
type: array
items:
$ref: '#/definitions/Person'
```
Note: YAML has a very similar feature, [YAML anchors](http://yaml.org/spec/1.2/spec.html#id2765878). Examples from this point will only be in JSON, using JSON References.
## Techniques
### Guidelines for Referencing
All references should follow the [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) specification.
JSON Reference provides guidance on the resolution of references, notably:
> If the URI contained in the JSON Reference value is a relative URI,
then the base URI resolution MUST be calculated according to
[RFC3986], section 5.2. Resolution is performed relative to the
referring document.
Whether you reference definitions locally or remote, you can never override or change their definitions from the referring location. The definitions can only be used as-is.
#### Local references
When referencing locally (within the current document), the target references should follow the conventions, as defined by the spec:
* Parameters -> `#/parameters`
* Responses -> `#/responses`
* Definitions (Models/Schema) -> `#/definitions`
An example of a local definition reference:
_Example from https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/json/petstore.json_
``` json
// ...
"200": {
"description": "pet response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
```
#### Remote references
##### Relative path
Files can be referred to in relative paths to the current document.
_Example from https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v2.0/json/petstore-separate/spec/swagger.json_
``` json
// ...
"responses": {
"default": {
"description": "unexpected error",
"schema": {
"$ref": "../common/Error.json"
}
}
}
```
Remote references may also reference properties within the relative remote file.
_Example from https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v2.0/json/petstore-separate/spec/swagger.json_
``` json
// ...
"parameters": [
{
"$ref": "parameters.json#/tagsParam"
},
{
"$ref": "parameters.json#/limitsParam"
}
]
```
##### URL
Remote files can be hosted on an HTTP server (rather than the local file system).
One risk of this approach is that environment specific issues could arise if DNS is not taken into account (as the reference can only contain one hostname).
_Assuming file https://my.company.com/definitions/Model.json_
```json
{
"description": "A simple model",
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"tag": {
"description": "A complex, shared property. Note the absolute reference",
"$ref": "https://my.company.com/definitions/Tag.json"
}
}
}
```
Remote references may also reference properties within the remote file.
_Assuming file https://my.company.com/definitions/models.json_
```json
{
"models": {
"Model": {
"description": "A simple model",
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"tag": {
"description": "a complex, shared property. Note the absolute reference",
"$ref": "https://my.company.com/definitions/models.json#/models/Tag"
}
}
},
"Tag": {
"description": "A tag entity in the system",
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
}
}
```
### Definitions
Reuse schema definitions by creating a repository of definitions. This is done by simply hosting a file or set of files for commonly used definitions across a company or organization.
Refer to [Guidelines for Referencing](#guidelines-for-referencing) for referencing strategies.
### Parameters
Similar to model schemas, you can create a repository of `parameters` to describe the common entities that appear throughout a set of systems.
Refer to [Guidelines for Referencing](#guidelines-for-referencing) for referencing strategies.
Using the same technique as above, you can host on either a single or multiple files. For simplicity, the example below assumes a single file.
_Assuming file https://my.company.com/parameters/parameters.json_
```json
{
"query" : {
"skip": {
"name": "skip",
"in": "query",
"description": "Results to skip when paginating through a result set",
"required": false,
"minimum": 0,
"type": "integer",
"format": "int32"
},
"limit": {
"name": "limit",
"in": "query",
"description": "Maximum number of results to return",
"required": false,
"minimum": 0,
"type": "integer",
"format": "int32"
}
}
}
```
To include these parameters, you would need to add them individually as such:
```json
{
"/pets": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A list of pets.",
"parameters" : [
{
"$ref": "https://my.company.com/parameters/parameters.json#/query/skip"
},
{
"$ref": "https://my.company.com/parameters/parameters.json#/query/limit"
},
{
"in": "query",
"name": "type",
"description": "the types of pet to return",
"required": false,
"type": "string"
}
],
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/pet"
}
}
}
}
}
}
}
```
### Operations
Again, Operations can be shared across files. Although the reusability of operations will be less than with Parameters and Definitions. For this example, we will share a common `health` resource so that all APIs can reference it:
Refer to [Guidelines for Referencing](#guidelines-for-referencing) for referencing strategies.
```json
{
"/health": {
"$ref": "http://localhost:8000/operations.json#/health"
}
}
```
Which points to the reference in the `operations.json` file:
```json
{
"health": {
"get": {
"tags": [
"admin"
],
"summary": "Returns server health information",
"operationId": "getHealth",
"produces": [
"application/json"
],
"parameters": [],
"responses": {
"200": {
"description": "Health information from the server",
"schema": {
"$ref": "http://localhost:8000/models.json#/Health"
}
}
}
}
}
}
```
Remember, you cannot override the definitions, but in this case, you can add additional operations on the same path level.
### Responses
Refer to [Guidelines for Referencing](#guidelines-for-referencing) for referencing strategies.
Assume the file `responses.json`:
```json
{
"NotFoundError": {
"description": "Entity not found",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
```
You can refer to it from a response definition:
```json
{
"/pets/{petId}": {
"get": {
"tags": [
"pet"
],
"summary": "Returns server health information",
"operationId": "getHealth",
"produces": [
"application/json"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet to return",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "The pet",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"400": {
"$ref": "http://localhost:8000/responses.json#/NotFoundError"
}
}
}
}
}
```
OpenAPI-Specification-3.1.0/package.json 0000664 0000000 0000000 00000001157 14013016525 0020013 0 ustar 00root root 0000000 0000000 {
"name": "oas-schemas",
"version": "2.0.0",
"description": "OpenAPI Specification JSON schemas",
"author": {
"name": "OpenAPI Initiative TSC",
"email": "tsc@openapis.org",
"url": "https://openapis.org/"
},
"repository": {
"type": "git",
"url": "https://github.com/OAI/OpenAPI-Specification.git"
},
"license": "Apache-2.0",
"readmeFilename": "README.md",
"files": [
"README.md",
"schemas/*"
],
"dependencies": {},
"devDependencies": {
"mdv": "^1.0.7",
"yaml": "^1.8.3"
},
"keywords": [
"OpenAPI",
"OAS",
"Swagger",
"schema",
"API"
]
}
OpenAPI-Specification-3.1.0/proposals/ 0000775 0000000 0000000 00000000000 14013016525 0017543 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/proposals/000_OAS-proposal-template.md 0000664 0000000 0000000 00000004332 14013016525 0024536 0 ustar 00root root 0000000 0000000 # Feature name
## Metadata
|Tag |Value |
|---- | ---------------- |
|Proposal |[NNNN](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/{directory_or_file_name})|
|Authors|[Author 1](https://github.com/{author1}), [Author 2](https://github.com/{author2})|
|Review Manager |TBD |
|Status |Proposal, Draft, Promoted, or Abandoned|
|Implementations |[Click Here](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/{NNNN}/implementations.md)|
|Issues |[{issueid}](https://github.com/OAI/OpenAPI-Specification/issues/{Issueid})|
|Previous Revisions |[{revid}](https://github.com/OAI/OpenAPI-Specification/pull/{revid}) |
## Change Log
|Date |Responsible Party |Description |
|---- | ---------------- | ---------- |
## Introduction
A short description of what the feature is. Try to keep it to a single-paragraph "elevator pitch" so the reader understands what problem this proposal is addressing.
## Motivation
Describe the problems that this proposal seeks to address. If the problem is that some common pattern is currently hard to express, show how one can currently get a similar effect and describe its drawbacks. If it's completely new functionality that cannot be emulated, motivate why this new functionality would help OpenAPI developers create better code.
## Proposed solution
Describe your solution to the problem. Provide examples and describe how they work. Show how your solution is better than current workarounds: is it cleaner, safer, or more efficient?
## Detailed design
Describe the design of the solution in detail. This should include an exact description of the changes to the contents of the OpenAPI specification. That description should include a extract of each section of the OpenAPI specification which is impacted by the proposal with all proposed modifications applied. These extracts may be provided through additional files which are identified and described in this section.
## Backwards compatibility
Proposals should be structure so that they can be handled by existing OAS compliant software. Any potential issues should be identified and discussed.
## Alternatives considered
Describe alternative approaches to addressing the same problem, and why you chose this approach instead.
OpenAPI-Specification-3.1.0/proposals/001_Alternative Schema Proposal.md 0000664 0000000 0000000 00000007671 14013016525 0025677 0 ustar 00root root 0000000 0000000 # Alternative Schema
## Metadata
|Tag |Value |
|---- | ---------------- |
|Proposal |[Alternative Schema](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/Alternative%20Schema)|
|Authors|[Chuck Heazel](https://github.com/{cmheazel})|
|Review Manager |TBD |
|Status |**Draft** |
|Implementations |[Click Here](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/Alternative%20Schema/implementations.md)
|Issues |[1532](https://github.com/OAI/OpenAPI-Specification/issues/1532)|
|Previous Revisions |[March 15](https://github.com/OAI/OpenAPI-Specification/pull/1868#issue-261689900) |
.Change Log
|Date |Responsible Party |Description |
|---- | ---------------- | ---------- |
|3/15/19 |C. Heazel|Initial Markup Draft |
|4/17/19 |C. Heazel|Re-structured based on Apple Swift|
## Introduction
This a proposal to add a new field called ``alternativeSchema`` to the OAS.
## Motivation
OpenAPI allows APIs to describe the syntax of their request and response messaged using a JSON Schema-like syntax. However, not all messages will be in JSON. The ability to refer to one or more external schema will allow an API to describe the syntax of a message regardless of the format used.
For example: Some XML payloads are defined by an XML schema (the syntax) and a suite of Schematron rules (valid values). JSON Schema cannot effectively represent their content. By providing access to the appropriate appropriate XML Schema and Schematron files, the payload can be validated the way it was intended to be.
## Proposed solution
This proposal makes the following changes to the OAS 3.0 specification:
1. Extend the Schema Object by the addition of the x-oas-draft-alternativeSchema field.
1. Addition of the Alternative Schema Object.
1. Addition of Alternative Schema examples.
1. Addition of a preliminary discussion of the Alternative Schema registry.
## Detailed design
### Extend the Schema Object
The OpenAPI Schema Object is extended by the addition of the x-oas-draft-alternativeSchema field. The proposed changes to the OpenAPI specification are provided in [schema_object.md](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/Alternative%20Schema/schema_object.md)
### Add the Alternative Schema Object
The new object, the Alternative Schema Object is added to the OpenAPI specification. The proposed changes to the OpenAPI specification are provided in [alternative_schema_object.md](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/Alternative%20Schema/alternative_schema_object.md)
### Provide Alternative Schema Examples
Examples of the use of the Alternative Schema capability is added to the OpenAPI specification. The proposed changes to the OpenAPI specification are provided in [alternative_schema_examples.md](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/Alternative%20Schema/alternative_schema_examples.md)
### Alternative Schema Registry
Values used to populate the Alternative Schema Object are required to come from the Alternative Schema Registry. The preliminary Alternative Schema Registry is located at .
*** Note this is a placeholder registry. Don't take the values seriously. ***
Inital contents of the registry will include:
|Name |Link |Description |
|--- | --- | --- |
|jsonSchema |TBD |JSON Schema | |xsdSchema |TBD |XML Schema |
## Backwards compatibility
This proposal makes use of the extensibility features of OpenAPI. All changes sould appear as extensions and handled accordingly.
## Alternatives considered
Embedding non-JSON content in the OAS document would have imposed an unacceptable burden on tooling. Therefore, an extenal link was prefered. Considerable discussion was held over exactly how the links should be represented in the Schema Object. The selected option should support the greatest number of possible combinations of external schema that can be expressed with the OpenAPI schema language.
OpenAPI-Specification-3.1.0/proposals/002_Webhooks.md 0000664 0000000 0000000 00000025106 14013016525 0022233 0 ustar 00root root 0000000 0000000 # Webhooks
## Metadata
|Tag |Value |
|---- | ---------------- |
|Proposal |[002_Webhooks](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/002_webhooks.md)|
|Authors|[Lorna Mitchell](https://github.com/lornajane)|
|Review Manager |TBD |
|Status |Proposal|
|Issues |[#1968](https://github.com/OAI/OpenAPI-Specification/issues/1968)|
## Change Log
|Date |Responsible Party |Description |
|---- | ---------------- | ---------- |
| 17th July 2019 | Lorna Mitchell | Initial draft |
## Introduction
Modern APIs often consist of two-way API traffic, but OpenAPI currently only supports some types of requests. Standard client-to-server API calls are well supported. Server-to-client callbacks are only supported if they are the result of an earlier API call and are documented by nesting under the path of that earlier call. Incoming HTTP reqests ("webhooks") cannot be described in the current version of OpenAPI if they are the result of subscription arranged outside of the scope of the API (e.g. by setting a callback URL in a web interface).
## Motivation
OpenAPI supports a `callback` element, where the result of an API call is delivered at some later time as an incoming HTTP request to a nominated URL. However it does not support webhooks, where events arrive as an incoming HTTP request but the configuration of these requests was arranged outside of the scope of the API, e.g. on a website.
For example: at Nexmo we have an SMS API (the docs are here: and the source spec here: ). It supports:
* sending an SMS (an outgoing API call, currently supported)
* receiving a delivery receipt when you just sent an SMS (callback, currently supported)
* receiving an incoming SMS (webhook, not currently supported)
The docs have an `x-webhooks` top-level element (we use [our own docs renderer](https://github.com/Nexmo/nexmo-oas-renderer)) and then a meaningless URL fieldname before the path item object that descrives the webhook.
On one of the other Nexmo APIs, we simply documented our webhooks in a markdown file separate from our API even though the two directions are very closely linked (see [Voice API webhook reference](https://developer.nexmo.com/voice/voice-api/webhook-reference) ).
Neither solution is great. I'm aware of other organisations (Ebay, GitHub) who also offer webhooks as part of their API platform who have run into the same problems when looking to adopt OpenAPI. The existing approach for callbacks, which allow a Path Item Object to be described in another location, could be adapted to also describe webhooks.
## Proposed solution
Allow a top-level `webhooks` element, with named entries inside it, each containing a Path Item Object. No other new fields or changes would be needed, since this already works brilliantly for `callbacks` within a path item. The only difference here is that there's no existing path item for the callback/webhook to belong to, and the URL is usually set somewhere else by the user (and there's no request context for an expression to be evaluated).
This solution builds on the existing proven approach for callbacks, but detaches them from the following-a-previous-API-call constraint.
To borrow the Nexmo SMS API example from above (because it's simple, I can add more examples as needed), the spec for the incoming webhook that occurs because a message has arrived might look like this:
```
webhooks:
inbound-sms:
post:
summary: Inbound SMS to your Nexmo number
operationId: inbound-sms
description: |
If you rent one or more virtual numbers from Nexmo, inbound messages to that number are sent to your [webhook endpoint](https://developer.nexmo.com/concepts/guides/webhooks).
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- msisdn
- to
- messageid
- text
- type
- keyword
- message-timestamp
properties:
msisdn:
type: string
description: the phone number that this inbound message was sent from. numbers are specified in e.164 format.
example: '447700900001'
to:
type: string
description: the phone number the message was sent to. **this is your virtual number**. numbers are specified in e.164 format.
example: '447700900000'
messageid:
type: string
description: the id of the message
example: 0a0000000123abcd1
text:
type: string
description: The message body for this inbound message.
example: Hello world
type:
type: string
description: |
Possible values are:
- `text` - standard text.
- `unicode` - URLencoded unicode . This is valid for standard GSM, Arabic, Chinese, double-encoded characters and so on.
- `binary` - a binary message.
example: 'text'
keyword:
type: string
description: The first word in the message body. This is typically used with short codes.
example: Hello
message-timestamp:
description: The time when Nexmo started to push this Delivery Receipt to your webhook endpoint.
type: string
example: 2020-01-01 12:00:00
responses:
'200':
description: |
Your server returns this code if it accepts the callback. Note that
Nexmo will retry messages that are not successfully acknowledged.
```
## Detailed design
### Add the `webhooks` top-level element to the list
**Existing Spec:**
```
#### OpenAPI Object
This is the root document object of the [OpenAPI document](#oasDocument).
##### 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](#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.
This object MAY be extended with [Specification Extensions](#specificationExtensions).
```
**Change: Add to the end of the table**
```
webhooks | [[Webhooks Object](#webhooksObject)] | The incoming webhooks that may be received as part of this API.
```
### Describe a new Webhook Object
(new spec section)
```
#### Webhooks Object
A map of webhooks that may be received as incoming HTTP requests as part of the API. The key of the map is a unique short name for the webhook e.g. `messageEvent`. 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.
Webhook Objects differ from [Callback Objects](#callbackObject) in that the webhooks are the result of some external event, not an earlier API call to subscribe or cause some other effect.
##### Webhook Object Example
The following example shows an incoming webhook delivering a status update for a particular item ID:
````yaml
webhooks:
statusUpdate:
requestBody:
description: Status updates on an item. You can set the URL for these updates in your example.com dashboard.
content:
'application/json':
schema:
type: object
required:
- item_id
- status
properties:
item_id:
type: string
description: The ID of the item
example: 0a000000012345678
status:
type: integer
description: The status of this message, zero for success
example: 14
responses:
'200':
description: webhook successfully processed and no retries will be performed
```
## Backwards compatibility
Adding a new top-level entry is not something to take lightly, however hopefully most tools will simply ignore what they weren't expecting and continue to operate on the parts of the spec they do understand until their functionality catches up with the spec change.
## Alternatives considered
Another option is to add a special `path` that could contain the various webhooks using the exisiting `callback` syntax but existing tools which aren't expecting this special value may not handle it well, so this option was discounted.
OpenAPI-Specification-3.1.0/proposals/003_Clarify-Nullable.md 0000664 0000000 0000000 00000040317 14013016525 0023601 0 ustar 00root root 0000000 0000000 # Clarify Semantics of `nullable` in OpenAPI 3.0
## Metadata
|Tag |Value |
|---- | ---------------- |
|Proposal |[003](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/003_Clarify-Nullable.md)|
|Authors|[Ted Epstein](https://github.com/tedepstein)|
|Review Manager |TBD|
|Status |Proposal|
|Implementations |N/A|
|Issues | [1900](https://github.com/OAI/OpenAPI-Specification/issues/1900), [1368](https://github.com/OAI/OpenAPI-Specification/issues/1368), [1389](https://github.com/OAI/OpenAPI-Specification/issues/1389), [1957](https://github.com/OAI/OpenAPI-Specification/pull/1957), [2046](https://github.com/OAI/OpenAPI-Specification/pull/2046), [1977](https://github.com/OAI/OpenAPI-Specification/pull/1977#issuecomment-533333957), [2057](https://github.com/OAI/OpenAPI-Specification/issues/2057)|
|Previous Revisions |N/A |
## Change Log
|Date |Responsible Party |Description |
|---- | ---------------- |------------|
|Oct 31, 2019 | Ted Epstein | Initial proposal |
## Introduction
This proposal aims to clarify the semantics of the `nullable` keyword in OpenAPI 3.0. This clarification would resolve ambiguities, reinforce the intended alignment with JSON Schema, and provide guidance for schema validators, translators, and other tools.
## Motivation
The documentation of the `nullable` keyword is incomplete and ambiguous, leaving many questions unanswered, and causing significant difficulty in reconciling certain assumed semantics with JSON Schema.
To summarize the problems:
* `nullable: true` is an _expanding assertion_ that doesn't fit JSON Schema's constraint-based processing model. It is not clear how it interacts with other keywords, and within what scope.
* `nullable: false`, which is the default value, is not clearly defined, and could be interpreted in a way that breaks fundamental assumptions of JSON Schema.
* Different OpenAPI schema validators and other tool implementations are likely to have different behaviors because the semantics of `nullable` are not fully specified.
* Because of the above ambiguities, it is not clear how to translate an OpenAPI Schema Object into a standard JSON Schema for message validation and for other purposes. Some possible interpretations of the OpenAPI spec could make translating to JSON Schema much more difficult.
* Depending on the interpretation, `nullable` might interact with `oneOf` and `anyOf` in problematic and counter-intuitive ways.
The solution proposed herein should:
* Clarify the boundaries around `nullable` so we know how it interacts with other assertions, applicators, subtypes and supertypes within its context.
* Clarify the meaning of `nullable: false`.
* Reaffirm the intended alignment of OpenAPI's Schema Object with JSON Schema, and reconcile `nullable` with JSON Schema semantics.
* Allow a straightforward translation from `nullable` in OpenAPI to type arrays in JSON Schema.
Further details follow.
### Primary Use Case for `nullable`
A Schema Object allows values of any data type, unless the type is restricted by the `type` keyword. The `type` keyword restricts the schema to a single data type, which can be `"string"`, `"number"`, `"integer"`, `"boolean"`, `"array"`, or `"object"`, but cannot be `"null"`.
Some APIs restrict values to a single data type, but also allow explicit null values. OpenAPI Schema Objects can allow explicit null values by combining the `type` and `nullable` keywords. A `nullable` value of `true` modifies a typed schema to allow non-null values of a given type, and also allow `null`. This was the envisioned use case, and the primary motivation for introducing `nullable` into the OpenAPI 3.0 spec.
There may be other possible usage scenarios or consequences of the `nullable` keyword, the way it is specified, or the way in which the spec may be interpreted or implemented. In our view, these other scenarios should be considered side effects or oversights. To the best of our knowledge, the `nullable` keyword was not intended for any purpose other than to allow `null` in a typed schema.
### Expanding vs. Constraining Assertions
`nullable: true` is an _expanding assertion_, meaning it has the effect of expanding the range of acceptable values. By contrast, JSON Schema's central operating principle is constraint-based, where _constraining assertions_ are cumulative, immutable, and each constraint has veto power to disallow some range of values.
The semantics of constraining assertions are well-defined by JSON Schema and implemented in many JSON Schema validators and other tools. But JSON Schema doesn't have expanding assertions, so those well-defined semantics don't apply to `nullable`.
To address this, we need to translate `nullable: true` into a constraining assertion. Otherwise, we would have to specify in detail how `nullable` interacts with constraining assertions like `enum` and with boolean applicators like `allOf` and `anyOf`.
### Interpretation of `nullable: false`
The documentation specifies that `nullable: false` is the default, but doesn't clearly state what that means.
One reasonable interpretation suggests that null values are disallowed unless `nullable` is explicitly set to `true`. This breaks a fundamental rule of JSON Schema, which states that an empty object `{}` is a valid schema that permits all values, with no constraints. Breaking that rule takes OpenAPI's Schema Object even further out of alignment with JSON Schema's processing model.
For example, if null values are disallowed by default, does the following `UTCDate` schema accept `null`?
```yaml
components:
schemas:
OptionalDate:
type: string
format: date
nullable: true
UTCDate:
allOf:
- $ref: "#/components/schemas/OptionalDate"
not:
type: string
pattern: "^.*Z.*$"
```
`UTCDate` does not specify a type of its own, and does not directly specify `nullable: true`. So if `null` is disallowed by default, even for untyped schemas, then `UTCDate` won't accept nulls. If we want it to accept nulls, we have to repeat `nullable: true` in `UTCDate`. This is not at all intuitive for API designers, and it breaks with JSON Schema's rule that any value is allowed unless it's explicitly disallowed.
On the other hand, we could say that `UTCDate` inherits `nullable: true` from `OptionalDate`, therefore null values are allowed. But this kind of inheritance logic is completely foreign to JSON Schema. So this behavior is also counterintuitive, though for a different reason. It's also difficult to implement. Any JSON Schema validator would need to be hacked in highly disruptive ways to retrofit this behavior. Or a preprocessor would have to be introduced to propagate the effect of `nullable: true` through the `*Of` inheritance hierarchy.
Whichever semantics we choose, it gets very messy.
### A closer look at `nullable: false`
In fact, the OpenAPI 3.0 specification doesn't explicitly say that untyped schemas disallow null values.
Here are the relevant parts:
#### Data Types
> Primitive data types in the OAS are based on the types supported by the JSON Schema Specification Wright Draft 00. 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 for an alternative solution). Models are defined using the Schema Object, which is an extended subset of JSON Schema Specification Wright Draft 00.
To say that null is "not supported _as a type_" would definitely disallow `type: "null"` in a schema object. But it doesn't necessarily mean that an untyped schema disallows _null values_.
#### Definition of `nullable`
> Allows sending a null value for the defined schema. Default value is false.
This uses the word "allows," but there's no mention of "disallows." To say that `nullable: true` _allows_ null where it would otherwise be prohibited, doesn't necessarily mean that `nullable: false` _disallows_ null where it would otherwise be allowed.
`nullable: true` _modifies_ a typed schema by adding null to the allowed types. `nullable: false` could mean "no null values allowed" or it could just mean "no modification to the specified type assertion, if any."
#### Schema Object
> 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.
There is no specified adjustment to the `type` property that disallows null values. So it should defer to the JSON Schema specification, which says that, in the absence of a `type` assertion, any valid JSON value is allowed.
So the 3.0 spec is ambiguous about null values. It's not clear whether the spec intended to disallow null values by default, even in untyped schemas. This looks more like an accidental oversight, or an unfortunate choice of words, than a clear intention.
### Specific Questions
Questions that are not answered by the current specification include the following:
* If a schema specifies `nullable: true` and `enum: [1, 2, 3]`, does that schema allow null values? (See [#1900](https://github.com/OAI/OpenAPI-Specification/issues/1900).)
* Does an untyped schema (without a `type` keyword) allow null values by default? What effect, if any, does `nullable: true` have on an untyped schema?
* Can `allOf` be used to define a nullable subtype of a non-nullable base schema? (See [#1368](https://github.com/OAI/OpenAPI-Specification/issues/1368).)
* Can `allOf` be used to define a non-nullable subtype of a nullable base schema?
* What is the correct translation of a nullable schema from OpenAPI into an equivalent JSON Schema?
* Is `null` allowed as the `default` value of a nullable schema? (See [#2057](https://github.com/OAI/OpenAPI-Specification/issues/2057).)
## Proposed solution
We propose to clarify the 3.0 specification in the next patch release, to resolve these questions and align OpenAPI's Schema Object with JSON Schema's well-defined, constraint-based semantics.
In our view, and consistent with the original intent, `nullable` should have a very limited, well-defined scope. It should satisfy the primary use case, i.e. allowing `null` in a typed schema, with minimal side effects.
This is the proposed replacement for the `nullable` definition:
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`.
## Detailed design
According to the above specification, `nullable` only operates within a narrow scope, wherein its translation to JSON Schema is straightforward:
* `nullable` is only meaningful if its value is `true`.
* `nullable: true` is only meaningful in combination with a `type` assertion specified in the same Schema Object. `nullable` acts as a `type` modifier, allowing `null` in addition to the specified type.
* `nullable: true` operates within a single Schema Object. It does not "override" or otherwise compete with supertype or subtype schemas defined with `allOf` or other applicators. It cannot be directly "inherited" through those applicators, and it cannot be applied to an inherited `type` constraint.
This also solves the issues of alignment with JSON Schema:
* Since `type` is a constraint, JSON Schema's constraint-based processing model is fully applicable. Interactions between `type` and other constraining assertions and applicators are unambiguous, with each constraint having independent veto power.
* It is now clear that `nullable: false`, whether explicit or by default, _does not_ prohibit null values. Consistent with JSON Schema, an empty object allows all values, including `null`.
### Questions Answered
Following are answers to the questions posed above, assuming the proposed clarification is adopted:
#### If a schema specifies `nullable: true` and `enum: [1, 2, 3]`, does that schema allow null values? (See [#1900](https://github.com/OAI/OpenAPI-Specification/issues/1900).)
No. The `nullable: true` assertion folds into the `type` assertion, which presumably specifies `integer` or `number`.
While the modified `type` now allows `null`, the `enum` does not. Consistent with JSON schema, a value conforms to the schema only if it is valid against _all_ constraints. Any constraint, in this case `enum`, can cause a value to fail validation, even if that value meets all of the other constraints.
#### Does an untyped schema (without a `type` keyword) allow null values by default? What effect, if any, does `nullable: true` have on an untyped schema?
Yes, an untyped schema allows null values, in addition to all other types. `nullable: true` has no effect, because null values are already allowed. And `nullable: false` has no effect because it just leaves the `type` constraint unmodified.
#### Can `allOf` be used to define a nullable subtype of a non-nullable base schema? (See [#1368](https://github.com/OAI/OpenAPI-Specification/issues/1368).)
No. Subtypes can add constraints, but not relax them.
#### Can `allOf` be used to define a non-nullable subtype of a nullable base schema?
Yes. The subtype can specify a `type` without `nullable: true`, or can specify `not: {enum: [null]}`.
#### What is the correct translation of a nullable schema from OpenAPI into an equivalent JSON Schema?
A nullable type should translate into a type array with two string elements: the name of the type specified in the Schema Object, and `"null"`.
#### Is `null` allowed as the `default` value of a nullable schema? (See [#2057](https://github.com/OAI/OpenAPI-Specification/issues/2057).)
Yes. For example, a Schema Object with `"type" : "string", "nullable" : true` would translate to a JSON Schema with `"type" : ["string", "null"]`. That schema permits `"default" : null`, even with the [strict typing rule](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#properties) specified by OpenAPI 3.0:
> 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`.
## Backwards compatibility
Spec revisions through 3.0.2 are ambiguous as described above, so any possible clarification has the potential to break existing implementations.
With the clarification of `nullable: false`, we think the risk of actual breakage is miniscule, because the current ambiguity only affects untyped Schema Objects, which by their nature leave a lot of room for unexpected values. Any implementation that relies on schema validation to prevent null values should use explicitly typed schemas, and typed schemas unambiguously disallow `null` unless `nullable` is `true`.
There might be a somewhat greater risk of breakage by specifying the effect of `nullable: true` as a `type` modifier. A more heavy-handed interpretation of `nullable: true`, [described here](https://github.com/OAI/OpenAPI-Specification/issues/1900#issuecomment-486772917), would make it equivalent to `anyOf [s, {type: "null"}]` where `s` is the schema as specified (excluding `nullable`). This would allow nulls even where they would be prohibited by other schema keywords, like `enum`. But this interpretation introduces far greater complexity than the narrowly scoped `type` modifier. We are not aware of any OpenAPI schema validator that actually attempts this, and there is nothing in the OpenAPI spec that says `nullable` can override constraining assertions.
## Alternatives considered
[Pull request #1977](https://github.com/OAI/OpenAPI-Specification/pull/1977#issuecomment-533333957) has some history of other approaches considered along the way. The first attempt assumed that `nullable: false` would prohibit null values, and attempted to work around this while maintaining backward compatibility.
On closer inspection, the specification does not say anything about `null` values being disallowed. So we believe our interpretation is correct, and highly advantageous in its alignment with JSON Schema.
OpenAPI-Specification-3.1.0/proposals/004_Overlays.md 0000664 0000000 0000000 00000021305 14013016525 0022255 0 ustar 00root root 0000000 0000000 # Overlays
## Metadata
|Tag |Value |
|---- | ---------------- |
|Proposal |[004_Overlays](https://github.com/OAI/OpenAPI-Specification/tree/master/proposals/004_overlays.md)|
|Authors|[Darrel Miller](https://github.com/darrelmiller)|
|Status |Proposal|
|Issues |[1442](https://github.com/OAI/OpenAPI-Specification/issues/1442) [1722](https://github.com/OAI/OpenAPI-Specification/issues/1722)|
## Change Log
|Date |Responsible Party |Description |
|---- | ---------------- | ---------- |
| 24th December 2019 | Darrel Miller | Initial draft |
| 2nd January 2019 | Darrel Miller | Update to wording around removing items from arrays. Added section on backward compatibility. Clarified process around applying a set of updates. Started to add supported scenarios.|
## Introduction
In recent months we have been discussing various use cases for overlays and various solutions. The following proposal takes a somewhat more radical approach to the problem. It is a more ambitious proposal than the others we have seen before but the additional complexity does allow for supporting many of the scenarios that have been discussed to date.
#### Overlay Document
An overlay document contains a list of [Update Objects](#overlayUpdates) that are to be applied to the target document. Each [Update Object](#updateObject) has a `target` property and a `value` property. The `target` property is a [JMESPath](http://jmespath.org/specification.html) query that identifies what part of the target document is to be updated and the `value` property contains an object with the properties to be overlaid.
#### Overlay Object
This is the root object of the [OpenAPI Overlay document](#oasDocument).
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
overlay | `string` | Version of the Overlay specification that this document conforms to.
info | [[Info Object](#overlayInfoObject)] | Identifying information about the overlay.
extends | `url` | URL to an OpenAPI document this overlay applies to.
updates | [[Update Object](#updateObject)] | A list of update objects to be applied to the target document.
The list of update objects MUST be applied in sequential order to ensure a consistent outcome. Updates are applied to the result of the previous updates. This enables objects to be deleted in one update and then re-created in a subsequent update.
The `extends` property can be used to indicate that the Overlay was designed to update a specific OpenAPI description. This is an optional property. Where no `extends` is provided it is the responsibility of tooling to apply the Overlay documents to the appropriate OpenAPI description.
#### Info Object
This object contains identifying information about the [OpenAPI Overlay document](#oasDocument).
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
title | `string` | A human readable description of the purpose of the overlay.
version | `string` | A version identifer for indicating changes to an overlay document.
#### Update Object
This object represents one or more changes to be applied to the target document at the location defined by the target JMESPath.
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
target | `string` | A JMESPath expression referencing the target objects in the target document.
value | [Any](#valueObject) | An object with the properties and values to be updated in the target document. Property has no impact if `remove` property is `true`.
remove | `boolean` | A boolean value that indicates that the target object is to be removed from the the map or array it is contained in. The default value is false.
The properties of the `Value Object` MUST be compatible with the target object referenced by the JMESPath key. When the Overlay document is applied, the properties in the `Value Object` replace properties in the target object with the same name and new properties are appended to the target object.
##### Structured Overlays Example
When updating properties throughout the target document it may be more efficient to create a single `Update Object` that mirrors the structure of the target document. e.g.
```yaml
overlay: 1.0.0
info:
title: Structured Overlay
version: 1.0.0
updates:
- target: "@"
value:
info:
x-overlay-applied: structured-overlay
paths:
"/":
summary: "The root resource"
get:
summary: "Retrieve the root resource"
x-rate-limit: 100
"/pets":
get:
summary: "Retrieve a list of pets"
x-rate-limit: 100
components:
tags:
```
##### Targeted Overlays
Alternatively, where only a small number of updates need to be applied to a large document, each [Update Object](#updateObject) can be more targeted.
```yaml
overlay: 1.0.0
info:
title: Structured Overlay
version: 1.0.0
updates:
- target: paths."/foo".get
value:
description: This is the new description
- target: paths."/bar".get
value:
description: This is the updated description
- target: paths."/bar"
value:
post:
description: This is an updated description of a child object
x-safe: false
```
##### Wildcard Overlays Examples
One significant advantage of using the JMESPath syntax that it allows referencing multiple nodes in the target document. This would allow a single update object to be applied to multiple target objects using wildcards.
```yaml
overlay: 1.0.0
info:
title: Update many objects at once
version: 1.0.0
updates:
- target: paths.*.get
value:
x-safe: true
- target: paths.*.get.parameters[?name=='filter' && in=='query']
value:
schema:
$ref: "/components/schemas/filterSchema"
```
##### Array Modification Examples
Due to the fact that we can now reference specific elements of the parameter array, it allows adding parameters. Parameters can be deleted using the `remove` property. Use of indexes to remove array items should be avoided where possible as indexes will change when items are removed.
```yaml
overlay: 1.0.0
info:
title: Add an array element
version: 1.0.0
updates:
- target: paths.*.get.parameters[length(@)]
value:
name: newParam
in: query
```
```yaml
overlay: 1.0.0
info:
title: Remove a array element
version: 1.0.0
updates:
- target: $.paths[*].get.parameters[? name == 'dummy']
remove: true
```
## Proposal Summary
### Benefits
- This approach addresses the two distinct approaches of structured overlay vs targeted overlay which suits distinct but equally valid scenarios.
- Addresses the problem of modifying the parameters array and removes the need to replace the entire array when a small change is required.
- Allows sets of related overlays to be stored in a same file.
- Enables updating a set of objects based on a pattern. This might be an effective way of apply common behaviour across many operations in an API.
### Challenges
- Tooling will need a JMESPath implementation.
- Large overlays may be slow to process.
- Multiple complex pattern based overlays may cause overlapping updates causing confusing outcomes.
## Alternatives considered
JMESPath was chosen over JSONPath due to the fact that JMESPath has a [specification](http://jmespath.org/specification.html) and a set of test cases. This will help to ensure compatibility between implementations.
## Backwards compatibility
Overlays will be described in a new specification that can be used alongside an OpenAPI Description, therefore there will be no compatibility issues for the initial release. Overlay documents can be used against OpenAPI v2 and v3 descriptions.
## Scenarios Considered
- Multi-language support. An Overlay document for each language is used to target a specific OpenAPI description. The Overlay document will likely use a duplicate structure to the original OpenAPI description and replace all `description` properties.
- Applying API wide standards. An Overlay document contains update objects that describe standard headers, parameters, responses. These documents would use JMESPath queries to target the appropriate objects in the OpenAPI description. Tooling could be used to target the OpenAPI description rather than using extends.
- Add tool specific OpenAPI metadata. Overlay adds additional metadata such as SLA information, client codegen hints or middleware policies. Using Overlays to manage this data separately is valuable when there is a different audience for the data and/or there the information has different sensitivity levels.
OpenAPI-Specification-3.1.0/proposals/Alternative Schema/ 0000775 0000000 0000000 00000000000 14013016525 0023202 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/proposals/Alternative Schema/CONTRIBUTORS.md 0000664 0000000 0000000 00000000170 14013016525 0025457 0 ustar 00root root 0000000 0000000 * Chuck Heazel [@cmheazel](https://github.com/cmheazel)
* Darrel Miller [@darrelmiller](https://github.com/darrelmiller) OpenAPI-Specification-3.1.0/proposals/Alternative Schema/DEVELOPMENT.md 0000664 0000000 0000000 00000000540 14013016525 0025305 0 ustar 00root root 0000000 0000000 ## Development Guidelines
TBD
## Specification Driving factors
TBD
## Specification Change Criteria
TBD
## Specification Change Process
TBD
## Tracking Process
* GitHub is the medium of record for all spec designs, use cases, and so on.
## Release Process
TBD
## Draft Features
## Transparency
## Participation
## Community Roles
OpenAPI-Specification-3.1.0/proposals/Alternative Schema/alternative_schema_examples.md 0000664 0000000 0000000 00000002553 14013016525 0031265 0 ustar 00root root 0000000 0000000 ## Change: Add Alternative Schema Examples
The following text is to be inserted after the Alternative Schema Object section.
### Alternative Schema Examples
Minimalist usage of alternative schema:
schema:
x-oas-draft-alternativeSchema:
type: jsonSchema
location: ./real-jsonschema.json
Combination of OAS schema and alternative:
schema:
type: object
nullable: true
x-oas-draft-alternativeSchema:
type: jsonSchema
location: ./real-jsonschema.json
Multiple different versions of alternative schema:
schema:
anyOf:
- x-oas-draft-alternativeSchema:
type: jsonSchema
location: ./real-jsonschema-08.json
- x-oas-draft-alternativeSchema:
type: jsonSchema
location: ./real-jsonschema-07.json
Combined alternative schemas:
schema:
allOf:
- x-oas-draft-alternativeSchema:
type: xmlSchema
location: ./xmlSchema.xsd
- x-oas-draft-alternativeSchema:
type: schematron
location: ./schema.sch
Mixed OAS schema and alternative schema:
schema:
type: array
items:
x-oas-draft-alternativeSchema:
type: jsonSchema
location: ./real-jsonschema.json
OpenAPI-Specification-3.1.0/proposals/Alternative Schema/alternative_schema_object.adoc 0000664 0000000 0000000 00000001624 14013016525 0031221 0 ustar 00root root 0000000 0000000 ## Change: Add the Alternative Schema Object
The following text is to be inserted after the XML Object section
### Alternative Schema Object
This object makes it possible to reference an external file that contains a schema that does not follow the OAS specification. If tooling does not support the _type_, tooling MUST consider the content valid but SHOULD provide a warning that the alternative schema was not processed.
==== Fixed Fields
|Field Name | Type | Description |
|---|:---:|---|
|type | string | **REQUIRED**. The value MUST match one of the values identified in the alternative Schema Registry. |
|location | url | **REQUIRED**. This is a absolute or relative reference to an external resource containing a schema of a known type. This reference may contain a fragment identifier to reference only a subset of an external document. |
This object MAY be extended with Specification Extensions.
OpenAPI-Specification-3.1.0/proposals/Alternative Schema/implementations.md 0000664 0000000 0000000 00000003024 14013016525 0026733 0 ustar 00root root 0000000 0000000 # Implementations
## Overview
Below is a list of tooling that claims to implement the Alternative Schema proposal. While support for this feature matures, refer to the details of projects listed below for any notes about stability and roadmap. The process to improve the OpenAPI specification includes feedback from end-users and tooling creators. We strongly encourage draft tooling be made available for early users of OAS drafts.
These tools are not endorsed by the OAI
## Implementations:
#### Low-Level tooling
| Title | Project Link | Language | Description
| ----------- | ----------- | ----------- | -----------
|TBD |TBD |TBD |TBD |
#### Editors
| Title | Project Link | Language |Description |
|----------------|--------------|----------|---------------------|
|TBD |TBD |TBD |TBD |
#### User Interfaces
| Title | Project Link | Language |Description |
|----------------|--------------|----------|---------------------|
|TBD |TBD |TBD |TBD |
#### Mock Servers
| Title | Project Link | Language | Description |
| -------------- | ------------ | -------- | ----------- |
|TBD |TBD |TBD |TBD |
#### Server Implementations
| Title | Project Link | Language |Description |
|----------------|--------------|----------|---------------------|
|TBD |TBD |TBD |TBD |
#### Code Generators
| Title | Project Link | Language |Description |
|----------------|--------------|----------|---------------------|
|TBD |TBD |TBD |TBD |
OpenAPI-Specification-3.1.0/proposals/Alternative Schema/schema_object.md 0000664 0000000 0000000 00000005257 14013016525 0026323 0 ustar 00root root 0000000 0000000 ## Change: Extend the Schema Object to support Alternative Schemas
The following content shall be used to replace the Fixed Fields table in the Schema Object section
#### Fixed Fields
|Field Name | Type | Description |
|---|:---:|---|
| nullable | `boolean` | Allows sending a `null` value for the defined schema. Default value is `false`.|
| discriminator | [Discriminator Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#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](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaComposition) 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](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#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](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#externalDocumentationObject) | 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`.|
|x-oas-draft-alternativeSchema |alternative Schema Object |An external schema that participates in the validation of content along with other schema keywords. |
OpenAPI-Specification-3.1.0/schemas/ 0000775 0000000 0000000 00000000000 14013016525 0017144 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/schemas/v1.2/ 0000775 0000000 0000000 00000000000 14013016525 0017632 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/schemas/v1.2/README.md 0000664 0000000 0000000 00000000505 14013016525 0021111 0 ustar 00root root 0000000 0000000 # Swagger Specification JSON Schemas
The work on the JSON Schema for the Swagger Specification was donated to the community by [Francis Galiegue](https://github.com/fge)!
Keep in mind that due to some JSON Schema limitations, not all constraints can be described. The missing constraints will be listed here in the future.
OpenAPI-Specification-3.1.0/schemas/v1.2/apiDeclaration.json 0000664 0000000 0000000 00000003616 14013016525 0023452 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/apiDeclaration.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [ "swaggerVersion", "basePath", "apis" ],
"properties": {
"swaggerVersion": { "enum": [ "1.2" ] },
"apiVersion": { "type": "string" },
"basePath": {
"type": "string",
"format": "uri",
"pattern": "^https?://"
},
"resourcePath": {
"type": "string",
"format": "uri",
"pattern": "^/"
},
"apis": {
"type": "array",
"items": { "$ref": "#/definitions/apiObject" }
},
"models": {
"type": "object",
"additionalProperties": {
"$ref": "modelsObject.json#"
}
},
"produces": { "$ref": "#/definitions/mimeTypeArray" },
"consumes": { "$ref": "#/definitions/mimeTypeArray" },
"authorizations": { "$ref": "authorizationObject.json#" }
},
"additionalProperties": false,
"definitions": {
"apiObject": {
"type": "object",
"required": [ "path", "operations" ],
"properties": {
"path": {
"type": "string",
"format": "uri-template",
"pattern": "^/"
},
"description": { "type": "string" },
"operations": {
"type": "array",
"items": { "$ref": "operationObject.json#" }
}
},
"additionalProperties": false
},
"mimeTypeArray": {
"type": "array",
"items": {
"type": "string",
"format": "mime-type"
},
"uniqueItems": true
}
}
}
OpenAPI-Specification-3.1.0/schemas/v1.2/authorizationObject.json 0000664 0000000 0000000 00000003431 14013016525 0024555 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/authorizationObject.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/basicAuth"
},
{
"$ref": "#/definitions/apiKey"
},
{
"$ref": "#/definitions/oauth2"
}
]
},
"definitions": {
"basicAuth": {
"required": [ "type" ],
"properties": {
"type": { "enum": [ "basicAuth" ] }
},
"additionalProperties": false
},
"apiKey": {
"required": [ "type", "passAs", "keyname" ],
"properties": {
"type": { "enum": [ "apiKey" ] },
"passAs": { "enum": [ "header", "query" ] },
"keyname": { "type": "string" }
},
"additionalProperties": false
},
"oauth2": {
"type": "object",
"required": [ "type", "grantTypes" ],
"properties": {
"type": { "enum": [ "oauth2" ] },
"scopes": {
"type": "array",
"items": { "$ref": "#/definitions/oauth2Scope" }
},
"grantTypes": { "$ref": "oauth2GrantType.json#" }
},
"additionalProperties": false
},
"oauth2Scope": {
"type": "object",
"required": [ "scope" ],
"properties": {
"scope": { "type": "string" },
"description": { "type": "string" }
},
"additionalProperties": false
}
}
}
OpenAPI-Specification-3.1.0/schemas/v1.2/dataType.json 0000664 0000000 0000000 00000010710 14013016525 0022277 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/dataType.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Data type as described by the specification (version 1.2)",
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/refType" },
{ "$ref": "#/definitions/voidType" },
{ "$ref": "#/definitions/primitiveType" },
{ "$ref": "#/definitions/modelType" },
{ "$ref": "#/definitions/arrayType" }
],
"definitions": {
"refType": {
"required": [ "$ref" ],
"properties": {
"$ref": { "type": "string" }
},
"additionalProperties": false
},
"voidType": {
"enum": [ { "type": "void" } ]
},
"modelType": {
"required": [ "type" ],
"properties": {
"type": {
"type": "string",
"not": {
"enum": [ "boolean", "integer", "number", "string", "array" ]
}
}
},
"additionalProperties": false
},
"primitiveType": {
"required": [ "type" ],
"properties": {
"type": {
"enum": [ "boolean", "integer", "number", "string" ]
},
"format": { "type": "string" },
"defaultValue": {
"not": { "type": [ "array", "object", "null" ] }
},
"enum": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"uniqueItems": true
},
"minimum": { "type": "string" },
"maximum": { "type": "string" }
},
"additionalProperties": false,
"dependencies": {
"format": {
"oneOf": [
{
"properties": {
"type": { "enum": [ "integer" ] },
"format": { "enum": [ "int32", "int64" ] }
}
},
{
"properties": {
"type": { "enum": [ "number" ] },
"format": { "enum": [ "float", "double" ] }
}
},
{
"properties": {
"type": { "enum": [ "string" ] },
"format": {
"enum": [ "byte", "date", "date-time" ]
}
}
}
]
},
"enum": {
"properties": {
"type": { "enum": [ "string" ] }
}
},
"minimum": {
"properties": {
"type": { "enum": [ "integer", "number" ] }
}
},
"maximum": {
"properties": {
"type": { "enum": [ "integer", "number" ] }
}
}
}
},
"arrayType": {
"required": [ "type", "items" ],
"properties": {
"type": { "enum": [ "array" ] },
"items": {
"type": "array",
"items": { "$ref": "#/definitions/itemsObject" }
},
"uniqueItems": { "type": "boolean" }
},
"additionalProperties": false
},
"itemsObject": {
"oneOf": [
{
"$ref": "#/definitions/refType"
},
{
"allOf": [
{
"$ref": "#/definitions/primitiveType"
},
{
"properties": {
"type": {},
"format": {}
},
"additionalProperties": false
}
]
}
]
}
}
} OpenAPI-Specification-3.1.0/schemas/v1.2/dataTypeBase.json 0000664 0000000 0000000 00000005032 14013016525 0023073 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/dataTypeBase.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Data type fields (section 4.3.3)",
"type": "object",
"oneOf": [
{ "required": [ "type" ] },
{ "required": [ "$ref" ] }
],
"properties": {
"type": { "type": "string" },
"$ref": { "type": "string" },
"format": { "type": "string" },
"defaultValue": {
"not": { "type": [ "array", "object", "null" ] }
},
"enum": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
"minItems": 1
},
"minimum": { "type": "string" },
"maximum": { "type": "string" },
"items": { "$ref": "#/definitions/itemsObject" },
"uniqueItems": { "type": "boolean" }
},
"dependencies": {
"format": {
"oneOf": [
{
"properties": {
"type": { "enum": [ "integer" ] },
"format": { "enum": [ "int32", "int64" ] }
}
},
{
"properties": {
"type": { "enum": [ "number" ] },
"format": { "enum": [ "float", "double" ] }
}
},
{
"properties": {
"type": { "enum": [ "string" ] },
"format": {
"enum": [ "byte", "date", "date-time" ]
}
}
}
]
}
},
"definitions": {
"itemsObject": {
"oneOf": [
{
"type": "object",
"required": [ "$ref" ],
"properties": {
"$ref": { "type": "string" }
},
"additionalProperties": false
},
{
"allOf": [
{ "$ref": "#" },
{
"required": [ "type" ],
"properties": {
"type": {},
"format": {}
},
"additionalProperties": false
}
]
}
]
}
}
}
OpenAPI-Specification-3.1.0/schemas/v1.2/infoObject.json 0000664 0000000 0000000 00000001225 14013016525 0022607 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/infoObject.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "info object (section 5.1.3)",
"type": "object",
"required": [ "title", "description" ],
"properties": {
"title": { "type": "string" },
"description": { "type": "string" },
"termsOfServiceUrl": { "type": "string", "format": "uri" },
"contact": { "type": "string", "format": "email" },
"license": { "type": "string" },
"licenseUrl": { "type": "string", "format": "uri" }
},
"additionalProperties": false
} OpenAPI-Specification-3.1.0/schemas/v1.2/modelsObject.json 0000664 0000000 0000000 00000001760 14013016525 0023143 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/modelsObject.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [ "id", "properties" ],
"properties": {
"id": { "type": "string" },
"description": { "type": "string" },
"properties": {
"type": "object",
"additionalProperties": { "$ref": "#/definitions/propertyObject" }
},
"subTypes": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true
},
"discriminator": { "type": "string" }
},
"dependencies": {
"subTypes": [ "discriminator" ]
},
"definitions": {
"propertyObject": {
"allOf": [
{
"not": { "$ref": "#" }
},
{
"$ref": "dataTypeBase.json#"
}
]
}
}
}
OpenAPI-Specification-3.1.0/schemas/v1.2/oauth2GrantType.json 0000664 0000000 0000000 00000003764 14013016525 0023577 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/oauth2GrantType.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"minProperties": 1,
"properties": {
"implicit": { "$ref": "#/definitions/implicit" },
"authorization_code": { "$ref": "#/definitions/authorizationCode" }
},
"definitions": {
"implicit": {
"type": "object",
"required": [ "loginEndpoint" ],
"properties": {
"loginEndpoint": { "$ref": "#/definitions/loginEndpoint" },
"tokenName": { "type": "string" }
},
"additionalProperties": false
},
"authorizationCode": {
"type": "object",
"required": [ "tokenEndpoint", "tokenRequestEndpoint" ],
"properties": {
"tokenEndpoint": { "$ref": "#/definitions/tokenEndpoint" },
"tokenRequestEndpoint": { "$ref": "#/definitions/tokenRequestEndpoint" }
},
"additionalProperties": false
},
"loginEndpoint": {
"type": "object",
"required": [ "url" ],
"properties": {
"url": { "type": "string", "format": "uri" }
},
"additionalProperties": false
},
"tokenEndpoint": {
"type": "object",
"required": [ "url" ],
"properties": {
"url": { "type": "string", "format": "uri" },
"tokenName": { "type": "string" }
},
"additionalProperties": false
},
"tokenRequestEndpoint": {
"type": "object",
"required": [ "url" ],
"properties": {
"url": { "type": "string", "format": "uri" },
"clientIdName": { "type": "string" },
"clientSecretName": { "type": "string" }
},
"additionalProperties": false
}
}
} OpenAPI-Specification-3.1.0/schemas/v1.2/operationObject.json 0000664 0000000 0000000 00000004467 14013016525 0023667 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/operationObject.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [
{ "$ref": "dataTypeBase.json#" },
{
"required": [ "method", "nickname", "parameters" ],
"properties": {
"method": { "enum": [ "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS" ] },
"summary": { "type": "string", "maxLength": 120 },
"notes": { "type": "string" },
"nickname": {
"type": "string",
"pattern": "^[a-zA-Z0-9_]+$"
},
"authorizations": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "authorizationObject.json#/definitions/oauth2Scope"
}
}
},
"parameters": {
"type": "array",
"items": { "$ref": "parameterObject.json#" }
},
"responseMessages": {
"type": "array",
"items": { "$ref": "#/definitions/responseMessageObject"}
},
"produces": { "$ref": "#/definitions/mimeTypeArray" },
"consumes": { "$ref": "#/definitions/mimeTypeArray" },
"deprecated": { "enum": [ "true", "false" ] }
}
}
],
"definitions": {
"responseMessageObject": {
"type": "object",
"required": [ "code", "message" ],
"properties": {
"code": { "$ref": "#/definitions/rfc2616section10" },
"message": { "type": "string" },
"responseModel": { "type": "string" }
}
},
"rfc2616section10": {
"type": "integer",
"minimum": 100,
"maximum": 600,
"exclusiveMaximum": true
},
"mimeTypeArray": {
"type": "array",
"items": {
"type": "string",
"format": "mime-type"
},
"uniqueItems": true
}
}
}
OpenAPI-Specification-3.1.0/schemas/v1.2/parameterObject.json 0000664 0000000 0000000 00000002406 14013016525 0023636 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/parameterObject.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"allOf": [
{ "$ref": "dataTypeBase.json#" },
{
"required": [ "paramType", "name" ],
"properties": {
"paramType": {
"enum": [ "path", "query", "body", "header", "form" ]
},
"name": { "type": "string" },
"description": { "type": "string" },
"required": { "type": "boolean" },
"allowMultiple": { "type": "boolean" }
}
},
{
"description": "type File requires special paramType and consumes",
"oneOf": [
{
"properties": {
"type": { "not": { "enum": [ "File" ] } }
}
},
{
"properties": {
"type": { "enum": [ "File" ] },
"paramType": { "enum": [ "form" ] },
"consumes": { "enum": [ "multipart/form-data" ] }
}
}
]
}
]
}
OpenAPI-Specification-3.1.0/schemas/v1.2/resourceListing.json 0000664 0000000 0000000 00000001120 14013016525 0023700 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/resourceListing.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [ "swaggerVersion", "apis" ],
"properties": {
"swaggerVersion": { "enum": [ "1.2" ] },
"apis": {
"type": "array",
"items": { "$ref": "resourceObject.json#" }
},
"apiVersion": { "type": "string" },
"info": { "$ref": "infoObject.json#" },
"authorizations": { "$ref": "authorizationObject.json#" }
}
}
OpenAPI-Specification-3.1.0/schemas/v1.2/resourceObject.json 0000664 0000000 0000000 00000000601 14013016525 0023500 0 ustar 00root root 0000000 0000000 {
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/resourceObject.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [ "path" ],
"properties": {
"path": { "type": "string", "format": "uri" },
"description": { "type": "string" }
},
"additionalProperties": false
} OpenAPI-Specification-3.1.0/schemas/v2.0/ 0000775 0000000 0000000 00000000000 14013016525 0017631 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/schemas/v2.0/README.md 0000664 0000000 0000000 00000000370 14013016525 0021110 0 ustar 00root root 0000000 0000000 # OpenAPI Specification v2.0 JSON Schema
This is the JSON Schema file for the OpenAPI Specification version 2.0. Download and install it via NPM.
## Install via NPM
```shell
npm install --save swagger-schema-official
```
## License
Apache-2.0
OpenAPI-Specification-3.1.0/schemas/v2.0/schema.json 0000664 0000000 0000000 00000116467 14013016525 0022003 0 ustar 00root root 0000000 0000000 {
"title": "A JSON Schema for Swagger 2.0 API.",
"id": "http://swagger.io/v2/schema.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"swagger",
"info",
"paths"
],
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"swagger": {
"type": "string",
"enum": [
"2.0"
],
"description": "The Swagger version of this document."
},
"info": {
"$ref": "#/definitions/info"
},
"host": {
"type": "string",
"pattern": "^[^{}/ :\\\\]+(?::\\d+)?$",
"description": "The host (name or ip) of the API. Example: 'swagger.io'"
},
"basePath": {
"type": "string",
"pattern": "^/",
"description": "The base path to the API. Example: '/api'."
},
"schemes": {
"$ref": "#/definitions/schemesList"
},
"consumes": {
"description": "A list of MIME types accepted by the API.",
"allOf": [
{
"$ref": "#/definitions/mediaTypeList"
}
]
},
"produces": {
"description": "A list of MIME types the API can produce.",
"allOf": [
{
"$ref": "#/definitions/mediaTypeList"
}
]
},
"paths": {
"$ref": "#/definitions/paths"
},
"definitions": {
"$ref": "#/definitions/definitions"
},
"parameters": {
"$ref": "#/definitions/parameterDefinitions"
},
"responses": {
"$ref": "#/definitions/responseDefinitions"
},
"security": {
"$ref": "#/definitions/security"
},
"securityDefinitions": {
"$ref": "#/definitions/securityDefinitions"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/tag"
},
"uniqueItems": true
},
"externalDocs": {
"$ref": "#/definitions/externalDocs"
}
},
"definitions": {
"info": {
"type": "object",
"description": "General information about the API.",
"required": [
"version",
"title"
],
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"title": {
"type": "string",
"description": "A unique and precise title of the API."
},
"version": {
"type": "string",
"description": "A semantic version number of the API."
},
"description": {
"type": "string",
"description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."
},
"termsOfService": {
"type": "string",
"description": "The terms of service for the API."
},
"contact": {
"$ref": "#/definitions/contact"
},
"license": {
"$ref": "#/definitions/license"
}
}
},
"contact": {
"type": "object",
"description": "Contact information for the owners of the API.",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The identifying name of the contact person/organization."
},
"url": {
"type": "string",
"description": "The URL pointing to the contact information.",
"format": "uri"
},
"email": {
"type": "string",
"description": "The email address of the contact person/organization.",
"format": "email"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"license": {
"type": "object",
"required": [
"name"
],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The name of the license type. It's encouraged to use an OSI compatible license."
},
"url": {
"type": "string",
"description": "The URL pointing to the license.",
"format": "uri"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"paths": {
"type": "object",
"description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
},
"^/": {
"$ref": "#/definitions/pathItem"
}
},
"additionalProperties": false
},
"definitions": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/schema"
},
"description": "One or more JSON objects describing the schemas being consumed and produced by the API."
},
"parameterDefinitions": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/parameter"
},
"description": "One or more JSON representations for parameters"
},
"responseDefinitions": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/response"
},
"description": "One or more JSON representations for responses"
},
"externalDocs": {
"type": "object",
"additionalProperties": false,
"description": "information about external documentation",
"required": [
"url"
],
"properties": {
"description": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"examples": {
"type": "object",
"additionalProperties": true
},
"mimeType": {
"type": "string",
"description": "The MIME type of the HTTP message."
},
"operation": {
"type": "object",
"required": [
"responses"
],
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"summary": {
"type": "string",
"description": "A brief summary of the operation."
},
"description": {
"type": "string",
"description": "A longer description of the operation, GitHub Flavored Markdown is allowed."
},
"externalDocs": {
"$ref": "#/definitions/externalDocs"
},
"operationId": {
"type": "string",
"description": "A unique identifier of the operation."
},
"produces": {
"description": "A list of MIME types the API can produce.",
"allOf": [
{
"$ref": "#/definitions/mediaTypeList"
}
]
},
"consumes": {
"description": "A list of MIME types the API can consume.",
"allOf": [
{
"$ref": "#/definitions/mediaTypeList"
}
]
},
"parameters": {
"$ref": "#/definitions/parametersList"
},
"responses": {
"$ref": "#/definitions/responses"
},
"schemes": {
"$ref": "#/definitions/schemesList"
},
"deprecated": {
"type": "boolean",
"default": false
},
"security": {
"$ref": "#/definitions/security"
}
}
},
"pathItem": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"$ref": {
"type": "string"
},
"get": {
"$ref": "#/definitions/operation"
},
"put": {
"$ref": "#/definitions/operation"
},
"post": {
"$ref": "#/definitions/operation"
},
"delete": {
"$ref": "#/definitions/operation"
},
"options": {
"$ref": "#/definitions/operation"
},
"head": {
"$ref": "#/definitions/operation"
},
"patch": {
"$ref": "#/definitions/operation"
},
"parameters": {
"$ref": "#/definitions/parametersList"
}
}
},
"responses": {
"type": "object",
"description": "Response objects names can either be any valid HTTP status code or 'default'.",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
"^([0-9]{3})$|^(default)$": {
"$ref": "#/definitions/responseValue"
},
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"not": {
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
}
},
"responseValue": {
"oneOf": [
{
"$ref": "#/definitions/response"
},
{
"$ref": "#/definitions/jsonReference"
}
]
},
"response": {
"type": "object",
"required": [
"description"
],
"properties": {
"description": {
"type": "string"
},
"schema": {
"oneOf": [
{
"$ref": "#/definitions/schema"
},
{
"$ref": "#/definitions/fileSchema"
}
]
},
"headers": {
"$ref": "#/definitions/headers"
},
"examples": {
"$ref": "#/definitions/examples"
}
},
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"headers": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/header"
}
},
"header": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string",
"number",
"integer",
"boolean",
"array"
]
},
"format": {
"type": "string"
},
"items": {
"$ref": "#/definitions/primitivesItems"
},
"collectionFormat": {
"$ref": "#/definitions/collectionFormat"
},
"default": {
"$ref": "#/definitions/default"
},
"maximum": {
"$ref": "#/definitions/maximum"
},
"exclusiveMaximum": {
"$ref": "#/definitions/exclusiveMaximum"
},
"minimum": {
"$ref": "#/definitions/minimum"
},
"exclusiveMinimum": {
"$ref": "#/definitions/exclusiveMinimum"
},
"maxLength": {
"$ref": "#/definitions/maxLength"
},
"minLength": {
"$ref": "#/definitions/minLength"
},
"pattern": {
"$ref": "#/definitions/pattern"
},
"maxItems": {
"$ref": "#/definitions/maxItems"
},
"minItems": {
"$ref": "#/definitions/minItems"
},
"uniqueItems": {
"$ref": "#/definitions/uniqueItems"
},
"enum": {
"$ref": "#/definitions/enum"
},
"multipleOf": {
"$ref": "#/definitions/multipleOf"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"vendorExtension": {
"description": "Any property starting with x- is valid.",
"additionalProperties": true,
"additionalItems": true
},
"bodyParameter": {
"type": "object",
"required": [
"name",
"in",
"schema"
],
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"description": {
"type": "string",
"description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
},
"name": {
"type": "string",
"description": "The name of the parameter."
},
"in": {
"type": "string",
"description": "Determines the location of the parameter.",
"enum": [
"body"
]
},
"required": {
"type": "boolean",
"description": "Determines whether or not this parameter is required or optional.",
"default": false
},
"schema": {
"$ref": "#/definitions/schema"
}
},
"additionalProperties": false
},
"headerParameterSubSchema": {
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"required": {
"type": "boolean",
"description": "Determines whether or not this parameter is required or optional.",
"default": false
},
"in": {
"type": "string",
"description": "Determines the location of the parameter.",
"enum": [
"header"
]
},
"description": {
"type": "string",
"description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
},
"name": {
"type": "string",
"description": "The name of the parameter."
},
"type": {
"type": "string",
"enum": [
"string",
"number",
"boolean",
"integer",
"array"
]
},
"format": {
"type": "string"
},
"items": {
"$ref": "#/definitions/primitivesItems"
},
"collectionFormat": {
"$ref": "#/definitions/collectionFormat"
},
"default": {
"$ref": "#/definitions/default"
},
"maximum": {
"$ref": "#/definitions/maximum"
},
"exclusiveMaximum": {
"$ref": "#/definitions/exclusiveMaximum"
},
"minimum": {
"$ref": "#/definitions/minimum"
},
"exclusiveMinimum": {
"$ref": "#/definitions/exclusiveMinimum"
},
"maxLength": {
"$ref": "#/definitions/maxLength"
},
"minLength": {
"$ref": "#/definitions/minLength"
},
"pattern": {
"$ref": "#/definitions/pattern"
},
"maxItems": {
"$ref": "#/definitions/maxItems"
},
"minItems": {
"$ref": "#/definitions/minItems"
},
"uniqueItems": {
"$ref": "#/definitions/uniqueItems"
},
"enum": {
"$ref": "#/definitions/enum"
},
"multipleOf": {
"$ref": "#/definitions/multipleOf"
}
}
},
"queryParameterSubSchema": {
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"required": {
"type": "boolean",
"description": "Determines whether or not this parameter is required or optional.",
"default": false
},
"in": {
"type": "string",
"description": "Determines the location of the parameter.",
"enum": [
"query"
]
},
"description": {
"type": "string",
"description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
},
"name": {
"type": "string",
"description": "The name of the parameter."
},
"allowEmptyValue": {
"type": "boolean",
"default": false,
"description": "allows sending a parameter by name only or with an empty value."
},
"type": {
"type": "string",
"enum": [
"string",
"number",
"boolean",
"integer",
"array"
]
},
"format": {
"type": "string"
},
"items": {
"$ref": "#/definitions/primitivesItems"
},
"collectionFormat": {
"$ref": "#/definitions/collectionFormatWithMulti"
},
"default": {
"$ref": "#/definitions/default"
},
"maximum": {
"$ref": "#/definitions/maximum"
},
"exclusiveMaximum": {
"$ref": "#/definitions/exclusiveMaximum"
},
"minimum": {
"$ref": "#/definitions/minimum"
},
"exclusiveMinimum": {
"$ref": "#/definitions/exclusiveMinimum"
},
"maxLength": {
"$ref": "#/definitions/maxLength"
},
"minLength": {
"$ref": "#/definitions/minLength"
},
"pattern": {
"$ref": "#/definitions/pattern"
},
"maxItems": {
"$ref": "#/definitions/maxItems"
},
"minItems": {
"$ref": "#/definitions/minItems"
},
"uniqueItems": {
"$ref": "#/definitions/uniqueItems"
},
"enum": {
"$ref": "#/definitions/enum"
},
"multipleOf": {
"$ref": "#/definitions/multipleOf"
}
}
},
"formDataParameterSubSchema": {
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"required": {
"type": "boolean",
"description": "Determines whether or not this parameter is required or optional.",
"default": false
},
"in": {
"type": "string",
"description": "Determines the location of the parameter.",
"enum": [
"formData"
]
},
"description": {
"type": "string",
"description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
},
"name": {
"type": "string",
"description": "The name of the parameter."
},
"allowEmptyValue": {
"type": "boolean",
"default": false,
"description": "allows sending a parameter by name only or with an empty value."
},
"type": {
"type": "string",
"enum": [
"string",
"number",
"boolean",
"integer",
"array",
"file"
]
},
"format": {
"type": "string"
},
"items": {
"$ref": "#/definitions/primitivesItems"
},
"collectionFormat": {
"$ref": "#/definitions/collectionFormatWithMulti"
},
"default": {
"$ref": "#/definitions/default"
},
"maximum": {
"$ref": "#/definitions/maximum"
},
"exclusiveMaximum": {
"$ref": "#/definitions/exclusiveMaximum"
},
"minimum": {
"$ref": "#/definitions/minimum"
},
"exclusiveMinimum": {
"$ref": "#/definitions/exclusiveMinimum"
},
"maxLength": {
"$ref": "#/definitions/maxLength"
},
"minLength": {
"$ref": "#/definitions/minLength"
},
"pattern": {
"$ref": "#/definitions/pattern"
},
"maxItems": {
"$ref": "#/definitions/maxItems"
},
"minItems": {
"$ref": "#/definitions/minItems"
},
"uniqueItems": {
"$ref": "#/definitions/uniqueItems"
},
"enum": {
"$ref": "#/definitions/enum"
},
"multipleOf": {
"$ref": "#/definitions/multipleOf"
}
}
},
"pathParameterSubSchema": {
"additionalProperties": false,
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"required": [
"required"
],
"properties": {
"required": {
"type": "boolean",
"enum": [
true
],
"description": "Determines whether or not this parameter is required or optional."
},
"in": {
"type": "string",
"description": "Determines the location of the parameter.",
"enum": [
"path"
]
},
"description": {
"type": "string",
"description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
},
"name": {
"type": "string",
"description": "The name of the parameter."
},
"type": {
"type": "string",
"enum": [
"string",
"number",
"boolean",
"integer",
"array"
]
},
"format": {
"type": "string"
},
"items": {
"$ref": "#/definitions/primitivesItems"
},
"collectionFormat": {
"$ref": "#/definitions/collectionFormat"
},
"default": {
"$ref": "#/definitions/default"
},
"maximum": {
"$ref": "#/definitions/maximum"
},
"exclusiveMaximum": {
"$ref": "#/definitions/exclusiveMaximum"
},
"minimum": {
"$ref": "#/definitions/minimum"
},
"exclusiveMinimum": {
"$ref": "#/definitions/exclusiveMinimum"
},
"maxLength": {
"$ref": "#/definitions/maxLength"
},
"minLength": {
"$ref": "#/definitions/minLength"
},
"pattern": {
"$ref": "#/definitions/pattern"
},
"maxItems": {
"$ref": "#/definitions/maxItems"
},
"minItems": {
"$ref": "#/definitions/minItems"
},
"uniqueItems": {
"$ref": "#/definitions/uniqueItems"
},
"enum": {
"$ref": "#/definitions/enum"
},
"multipleOf": {
"$ref": "#/definitions/multipleOf"
}
}
},
"nonBodyParameter": {
"type": "object",
"required": [
"name",
"in",
"type"
],
"oneOf": [
{
"$ref": "#/definitions/headerParameterSubSchema"
},
{
"$ref": "#/definitions/formDataParameterSubSchema"
},
{
"$ref": "#/definitions/queryParameterSubSchema"
},
{
"$ref": "#/definitions/pathParameterSubSchema"
}
]
},
"parameter": {
"oneOf": [
{
"$ref": "#/definitions/bodyParameter"
},
{
"$ref": "#/definitions/nonBodyParameter"
}
]
},
"schema": {
"type": "object",
"description": "A deterministic version of a JSON Schema object.",
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"properties": {
"$ref": {
"type": "string"
},
"format": {
"type": "string"
},
"title": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/title"
},
"description": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/description"
},
"default": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/default"
},
"multipleOf": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
},
"maximum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
},
"exclusiveMaximum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
},
"minimum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
},
"exclusiveMinimum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
},
"maxLength": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
},
"minLength": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
},
"pattern": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
},
"maxItems": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
},
"minItems": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
},
"uniqueItems": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
},
"maxProperties": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
},
"minProperties": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
},
"required": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
},
"enum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
},
"additionalProperties": {
"anyOf": [
{
"$ref": "#/definitions/schema"
},
{
"type": "boolean"
}
],
"default": {}
},
"type": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/type"
},
"items": {
"anyOf": [
{
"$ref": "#/definitions/schema"
},
{
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/schema"
}
}
],
"default": {}
},
"allOf": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/schema"
}
},
"properties": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/schema"
},
"default": {}
},
"discriminator": {
"type": "string"
},
"readOnly": {
"type": "boolean",
"default": false
},
"xml": {
"$ref": "#/definitions/xml"
},
"externalDocs": {
"$ref": "#/definitions/externalDocs"
},
"example": {}
},
"additionalProperties": false
},
"fileSchema": {
"type": "object",
"description": "A deterministic version of a JSON Schema object.",
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
},
"required": [
"type"
],
"properties": {
"format": {
"type": "string"
},
"title": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/title"
},
"description": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/description"
},
"default": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/default"
},
"required": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
},
"type": {
"type": "string",
"enum": [
"file"
]
},
"readOnly": {
"type": "boolean",
"default": false
},
"externalDocs": {
"$ref": "#/definitions/externalDocs"
},
"example": {}
},
"additionalProperties": false
},
"primitivesItems": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"enum": [
"string",
"number",
"integer",
"boolean",
"array"
]
},
"format": {
"type": "string"
},
"items": {
"$ref": "#/definitions/primitivesItems"
},
"collectionFormat": {
"$ref": "#/definitions/collectionFormat"
},
"default": {
"$ref": "#/definitions/default"
},
"maximum": {
"$ref": "#/definitions/maximum"
},
"exclusiveMaximum": {
"$ref": "#/definitions/exclusiveMaximum"
},
"minimum": {
"$ref": "#/definitions/minimum"
},
"exclusiveMinimum": {
"$ref": "#/definitions/exclusiveMinimum"
},
"maxLength": {
"$ref": "#/definitions/maxLength"
},
"minLength": {
"$ref": "#/definitions/minLength"
},
"pattern": {
"$ref": "#/definitions/pattern"
},
"maxItems": {
"$ref": "#/definitions/maxItems"
},
"minItems": {
"$ref": "#/definitions/minItems"
},
"uniqueItems": {
"$ref": "#/definitions/uniqueItems"
},
"enum": {
"$ref": "#/definitions/enum"
},
"multipleOf": {
"$ref": "#/definitions/multipleOf"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"security": {
"type": "array",
"items": {
"$ref": "#/definitions/securityRequirement"
},
"uniqueItems": true
},
"securityRequirement": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
}
},
"xml": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"prefix": {
"type": "string"
},
"attribute": {
"type": "boolean",
"default": false
},
"wrapped": {
"type": "boolean",
"default": false
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"tag": {
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"externalDocs": {
"$ref": "#/definitions/externalDocs"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"securityDefinitions": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/basicAuthenticationSecurity"
},
{
"$ref": "#/definitions/apiKeySecurity"
},
{
"$ref": "#/definitions/oauth2ImplicitSecurity"
},
{
"$ref": "#/definitions/oauth2PasswordSecurity"
},
{
"$ref": "#/definitions/oauth2ApplicationSecurity"
},
{
"$ref": "#/definitions/oauth2AccessCodeSecurity"
}
]
}
},
"basicAuthenticationSecurity": {
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"basic"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"apiKeySecurity": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"name",
"in"
],
"properties": {
"type": {
"type": "string",
"enum": [
"apiKey"
]
},
"name": {
"type": "string"
},
"in": {
"type": "string",
"enum": [
"header",
"query"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"oauth2ImplicitSecurity": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"flow",
"authorizationUrl"
],
"properties": {
"type": {
"type": "string",
"enum": [
"oauth2"
]
},
"flow": {
"type": "string",
"enum": [
"implicit"
]
},
"scopes": {
"$ref": "#/definitions/oauth2Scopes"
},
"authorizationUrl": {
"type": "string",
"format": "uri"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"oauth2PasswordSecurity": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"flow",
"tokenUrl"
],
"properties": {
"type": {
"type": "string",
"enum": [
"oauth2"
]
},
"flow": {
"type": "string",
"enum": [
"password"
]
},
"scopes": {
"$ref": "#/definitions/oauth2Scopes"
},
"tokenUrl": {
"type": "string",
"format": "uri"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"oauth2ApplicationSecurity": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"flow",
"tokenUrl"
],
"properties": {
"type": {
"type": "string",
"enum": [
"oauth2"
]
},
"flow": {
"type": "string",
"enum": [
"application"
]
},
"scopes": {
"$ref": "#/definitions/oauth2Scopes"
},
"tokenUrl": {
"type": "string",
"format": "uri"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"oauth2AccessCodeSecurity": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"flow",
"authorizationUrl",
"tokenUrl"
],
"properties": {
"type": {
"type": "string",
"enum": [
"oauth2"
]
},
"flow": {
"type": "string",
"enum": [
"accessCode"
]
},
"scopes": {
"$ref": "#/definitions/oauth2Scopes"
},
"authorizationUrl": {
"type": "string",
"format": "uri"
},
"tokenUrl": {
"type": "string",
"format": "uri"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
},
"oauth2Scopes": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"mediaTypeList": {
"type": "array",
"items": {
"$ref": "#/definitions/mimeType"
},
"uniqueItems": true
},
"parametersList": {
"type": "array",
"description": "The parameters needed to send a valid API call.",
"additionalItems": false,
"items": {
"oneOf": [
{
"$ref": "#/definitions/parameter"
},
{
"$ref": "#/definitions/jsonReference"
}
]
},
"uniqueItems": true
},
"schemesList": {
"type": "array",
"description": "The transfer protocol of the API.",
"items": {
"type": "string",
"enum": [
"http",
"https",
"ws",
"wss"
]
},
"uniqueItems": true
},
"collectionFormat": {
"type": "string",
"enum": [
"csv",
"ssv",
"tsv",
"pipes"
],
"default": "csv"
},
"collectionFormatWithMulti": {
"type": "string",
"enum": [
"csv",
"ssv",
"tsv",
"pipes",
"multi"
],
"default": "csv"
},
"title": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/title"
},
"description": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/description"
},
"default": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/default"
},
"multipleOf": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
},
"maximum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
},
"exclusiveMaximum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
},
"minimum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
},
"exclusiveMinimum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
},
"maxLength": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
},
"minLength": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
},
"pattern": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
},
"maxItems": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
},
"minItems": {
"$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
},
"uniqueItems": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
},
"enum": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
},
"jsonReference": {
"type": "object",
"required": [
"$ref"
],
"additionalProperties": false,
"properties": {
"$ref": {
"type": "string"
}
}
}
}
} OpenAPI-Specification-3.1.0/schemas/v3.0/ 0000775 0000000 0000000 00000000000 14013016525 0017632 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/schemas/v3.0/README.md 0000664 0000000 0000000 00000001572 14013016525 0021116 0 ustar 00root root 0000000 0000000 OpenAPI 3.0.X JSON Schema
---
Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.X.
As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins. Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance.
The iteration version of the JSON Schema can be found in the `id` field. For example, the value of `id: https://spec.openapis.org/oas/3.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019.
To submit improvements to the schema, modify the schema.yaml file only.
The TSC will then:
- Run tests on the updated schema
- Update the iteration version
- Convert the schema.yaml to schema.json
- Publish the new version
OpenAPI-Specification-3.1.0/schemas/v3.0/schema.json 0000664 0000000 0000000 00000105200 14013016525 0021763 0 ustar 00root root 0000000 0000000 {
"id": "https://spec.openapis.org/oas/3.0/schema/2019-04-02",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Validation schema for OpenAPI Specification 3.0.X.",
"type": "object",
"required": [
"openapi",
"info",
"paths"
],
"properties": {
"openapi": {
"type": "string",
"pattern": "^3\\.0\\.\\d(-.+)?$"
},
"info": {
"$ref": "#/definitions/Info"
},
"externalDocs": {
"$ref": "#/definitions/ExternalDocumentation"
},
"servers": {
"type": "array",
"items": {
"$ref": "#/definitions/Server"
}
},
"security": {
"type": "array",
"items": {
"$ref": "#/definitions/SecurityRequirement"
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/Tag"
},
"uniqueItems": true
},
"paths": {
"$ref": "#/definitions/Paths"
},
"components": {
"$ref": "#/definitions/Components"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false,
"definitions": {
"Reference": {
"type": "object",
"required": [
"$ref"
],
"patternProperties": {
"^\\$ref$": {
"type": "string",
"format": "uri-reference"
}
}
},
"Info": {
"type": "object",
"required": [
"title",
"version"
],
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"termsOfService": {
"type": "string",
"format": "uri-reference"
},
"contact": {
"$ref": "#/definitions/Contact"
},
"license": {
"$ref": "#/definitions/License"
},
"version": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Contact": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri-reference"
},
"email": {
"type": "string",
"format": "email"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"License": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri-reference"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Server": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string"
},
"description": {
"type": "string"
},
"variables": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ServerVariable"
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"ServerVariable": {
"type": "object",
"required": [
"default"
],
"properties": {
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"default": {
"type": "string"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Components": {
"type": "object",
"properties": {
"schemas": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
}
}
},
"responses": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/Response"
}
]
}
}
},
"parameters": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/Parameter"
}
]
}
}
},
"examples": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/Example"
}
]
}
}
},
"requestBodies": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/RequestBody"
}
]
}
}
},
"headers": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/Header"
}
]
}
}
},
"securitySchemes": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/SecurityScheme"
}
]
}
}
},
"links": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/Link"
}
]
}
}
},
"callbacks": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9\\.\\-_]+$": {
"oneOf": [
{
"$ref": "#/definitions/Reference"
},
{
"$ref": "#/definitions/Callback"
}
]
}
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"multipleOf": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "boolean",
"default": false
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "boolean",
"default": false
},
"maxLength": {
"type": "integer",
"minimum": 0
},
"minLength": {
"type": "integer",
"minimum": 0,
"default": 0
},
"pattern": {
"type": "string",
"format": "regex"
},
"maxItems": {
"type": "integer",
"minimum": 0
},
"minItems": {
"type": "integer",
"minimum": 0,
"default": 0
},
"uniqueItems": {
"type": "boolean",
"default": false
},
"maxProperties": {
"type": "integer",
"minimum": 0
},
"minProperties": {
"type": "integer",
"minimum": 0,
"default": 0
},
"required": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"enum": {
"type": "array",
"items": {
},
"minItems": 1,
"uniqueItems": false
},
"type": {
"type": "string",
"enum": [
"array",
"boolean",
"integer",
"number",
"object",
"string"
]
},
"not": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"allOf": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"oneOf": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"anyOf": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"items": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"properties": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
},
{
"type": "boolean"
}
],
"default": true
},
"description": {
"type": "string"
},
"format": {
"type": "string"
},
"default": {
},
"nullable": {
"type": "boolean",
"default": false
},
"discriminator": {
"$ref": "#/definitions/Discriminator"
},
"readOnly": {
"type": "boolean",
"default": false
},
"writeOnly": {
"type": "boolean",
"default": false
},
"example": {
},
"externalDocs": {
"$ref": "#/definitions/ExternalDocumentation"
},
"deprecated": {
"type": "boolean",
"default": false
},
"xml": {
"$ref": "#/definitions/XML"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Discriminator": {
"type": "object",
"required": [
"propertyName"
],
"properties": {
"propertyName": {
"type": "string"
},
"mapping": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"XML": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"namespace": {
"type": "string",
"format": "uri"
},
"prefix": {
"type": "string"
},
"attribute": {
"type": "boolean",
"default": false
},
"wrapped": {
"type": "boolean",
"default": false
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Response": {
"type": "object",
"required": [
"description"
],
"properties": {
"description": {
"type": "string"
},
"headers": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Header"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"content": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/MediaType"
}
},
"links": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Link"
},
{
"$ref": "#/definitions/Reference"
}
]
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"MediaType": {
"type": "object",
"properties": {
"schema": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"example": {
},
"examples": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Example"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"encoding": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Encoding"
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false,
"allOf": [
{
"$ref": "#/definitions/ExampleXORExamples"
}
]
},
"Example": {
"type": "object",
"properties": {
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"value": {
},
"externalValue": {
"type": "string",
"format": "uri-reference"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Header": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"required": {
"type": "boolean",
"default": false
},
"deprecated": {
"type": "boolean",
"default": false
},
"allowEmptyValue": {
"type": "boolean",
"default": false
},
"style": {
"type": "string",
"enum": [
"simple"
],
"default": "simple"
},
"explode": {
"type": "boolean"
},
"allowReserved": {
"type": "boolean",
"default": false
},
"schema": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"content": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/MediaType"
},
"minProperties": 1,
"maxProperties": 1
},
"example": {
},
"examples": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Example"
},
{
"$ref": "#/definitions/Reference"
}
]
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false,
"allOf": [
{
"$ref": "#/definitions/ExampleXORExamples"
},
{
"$ref": "#/definitions/SchemaXORContent"
}
]
},
"Paths": {
"type": "object",
"patternProperties": {
"^\\/": {
"$ref": "#/definitions/PathItem"
},
"^x-": {
}
},
"additionalProperties": false
},
"PathItem": {
"type": "object",
"properties": {
"$ref": {
"type": "string"
},
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"servers": {
"type": "array",
"items": {
"$ref": "#/definitions/Server"
}
},
"parameters": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/Parameter"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"uniqueItems": true
}
},
"patternProperties": {
"^(get|put|post|delete|options|head|patch|trace)$": {
"$ref": "#/definitions/Operation"
},
"^x-": {
}
},
"additionalProperties": false
},
"Operation": {
"type": "object",
"required": [
"responses"
],
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"externalDocs": {
"$ref": "#/definitions/ExternalDocumentation"
},
"operationId": {
"type": "string"
},
"parameters": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/Parameter"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"uniqueItems": true
},
"requestBody": {
"oneOf": [
{
"$ref": "#/definitions/RequestBody"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"responses": {
"$ref": "#/definitions/Responses"
},
"callbacks": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Callback"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"deprecated": {
"type": "boolean",
"default": false
},
"security": {
"type": "array",
"items": {
"$ref": "#/definitions/SecurityRequirement"
}
},
"servers": {
"type": "array",
"items": {
"$ref": "#/definitions/Server"
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Responses": {
"type": "object",
"properties": {
"default": {
"oneOf": [
{
"$ref": "#/definitions/Response"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"patternProperties": {
"^[1-5](?:\\d{2}|XX)$": {
"oneOf": [
{
"$ref": "#/definitions/Response"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"^x-": {
}
},
"minProperties": 1,
"additionalProperties": false
},
"SecurityRequirement": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"Tag": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"externalDocs": {
"$ref": "#/definitions/ExternalDocumentation"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"ExternalDocumentation": {
"type": "object",
"required": [
"url"
],
"properties": {
"description": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri-reference"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"ExampleXORExamples": {
"description": "Example and examples are mutually exclusive",
"not": {
"required": [
"example",
"examples"
]
}
},
"SchemaXORContent": {
"description": "Schema and content are mutually exclusive, at least one is required",
"not": {
"required": [
"schema",
"content"
]
},
"oneOf": [
{
"required": [
"schema"
]
},
{
"required": [
"content"
],
"description": "Some properties are not allowed if content is present",
"allOf": [
{
"not": {
"required": [
"style"
]
}
},
{
"not": {
"required": [
"explode"
]
}
},
{
"not": {
"required": [
"allowReserved"
]
}
},
{
"not": {
"required": [
"example"
]
}
},
{
"not": {
"required": [
"examples"
]
}
}
]
}
]
},
"Parameter": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"in": {
"type": "string"
},
"description": {
"type": "string"
},
"required": {
"type": "boolean",
"default": false
},
"deprecated": {
"type": "boolean",
"default": false
},
"allowEmptyValue": {
"type": "boolean",
"default": false
},
"style": {
"type": "string"
},
"explode": {
"type": "boolean"
},
"allowReserved": {
"type": "boolean",
"default": false
},
"schema": {
"oneOf": [
{
"$ref": "#/definitions/Schema"
},
{
"$ref": "#/definitions/Reference"
}
]
},
"content": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/MediaType"
},
"minProperties": 1,
"maxProperties": 1
},
"example": {
},
"examples": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/Example"
},
{
"$ref": "#/definitions/Reference"
}
]
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false,
"required": [
"name",
"in"
],
"allOf": [
{
"$ref": "#/definitions/ExampleXORExamples"
},
{
"$ref": "#/definitions/SchemaXORContent"
},
{
"$ref": "#/definitions/ParameterLocation"
}
]
},
"ParameterLocation": {
"description": "Parameter location",
"oneOf": [
{
"description": "Parameter in path",
"required": [
"required"
],
"properties": {
"in": {
"enum": [
"path"
]
},
"style": {
"enum": [
"matrix",
"label",
"simple"
],
"default": "simple"
},
"required": {
"enum": [
true
]
}
}
},
{
"description": "Parameter in query",
"properties": {
"in": {
"enum": [
"query"
]
},
"style": {
"enum": [
"form",
"spaceDelimited",
"pipeDelimited",
"deepObject"
],
"default": "form"
}
}
},
{
"description": "Parameter in header",
"properties": {
"in": {
"enum": [
"header"
]
},
"style": {
"enum": [
"simple"
],
"default": "simple"
}
}
},
{
"description": "Parameter in cookie",
"properties": {
"in": {
"enum": [
"cookie"
]
},
"style": {
"enum": [
"form"
],
"default": "form"
}
}
}
]
},
"RequestBody": {
"type": "object",
"required": [
"content"
],
"properties": {
"description": {
"type": "string"
},
"content": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/MediaType"
}
},
"required": {
"type": "boolean",
"default": false
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"SecurityScheme": {
"oneOf": [
{
"$ref": "#/definitions/APIKeySecurityScheme"
},
{
"$ref": "#/definitions/HTTPSecurityScheme"
},
{
"$ref": "#/definitions/OAuth2SecurityScheme"
},
{
"$ref": "#/definitions/OpenIdConnectSecurityScheme"
}
]
},
"APIKeySecurityScheme": {
"type": "object",
"required": [
"type",
"name",
"in"
],
"properties": {
"type": {
"type": "string",
"enum": [
"apiKey"
]
},
"name": {
"type": "string"
},
"in": {
"type": "string",
"enum": [
"header",
"query",
"cookie"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"HTTPSecurityScheme": {
"type": "object",
"required": [
"scheme",
"type"
],
"properties": {
"scheme": {
"type": "string"
},
"bearerFormat": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"http"
]
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false,
"oneOf": [
{
"description": "Bearer",
"properties": {
"scheme": {
"enum": [
"bearer"
]
}
}
},
{
"description": "Non Bearer",
"not": {
"required": [
"bearerFormat"
]
},
"properties": {
"scheme": {
"not": {
"enum": [
"bearer"
]
}
}
}
}
]
},
"OAuth2SecurityScheme": {
"type": "object",
"required": [
"type",
"flows"
],
"properties": {
"type": {
"type": "string",
"enum": [
"oauth2"
]
},
"flows": {
"$ref": "#/definitions/OAuthFlows"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"OpenIdConnectSecurityScheme": {
"type": "object",
"required": [
"type",
"openIdConnectUrl"
],
"properties": {
"type": {
"type": "string",
"enum": [
"openIdConnect"
]
},
"openIdConnectUrl": {
"type": "string",
"format": "uri-reference"
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"OAuthFlows": {
"type": "object",
"properties": {
"implicit": {
"$ref": "#/definitions/ImplicitOAuthFlow"
},
"password": {
"$ref": "#/definitions/PasswordOAuthFlow"
},
"clientCredentials": {
"$ref": "#/definitions/ClientCredentialsFlow"
},
"authorizationCode": {
"$ref": "#/definitions/AuthorizationCodeOAuthFlow"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"ImplicitOAuthFlow": {
"type": "object",
"required": [
"authorizationUrl",
"scopes"
],
"properties": {
"authorizationUrl": {
"type": "string",
"format": "uri-reference"
},
"refreshUrl": {
"type": "string",
"format": "uri-reference"
},
"scopes": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"PasswordOAuthFlow": {
"type": "object",
"required": [
"tokenUrl"
],
"properties": {
"tokenUrl": {
"type": "string",
"format": "uri-reference"
},
"refreshUrl": {
"type": "string",
"format": "uri-reference"
},
"scopes": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"ClientCredentialsFlow": {
"type": "object",
"required": [
"tokenUrl"
],
"properties": {
"tokenUrl": {
"type": "string",
"format": "uri-reference"
},
"refreshUrl": {
"type": "string",
"format": "uri-reference"
},
"scopes": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"AuthorizationCodeOAuthFlow": {
"type": "object",
"required": [
"authorizationUrl",
"tokenUrl"
],
"properties": {
"authorizationUrl": {
"type": "string",
"format": "uri-reference"
},
"tokenUrl": {
"type": "string",
"format": "uri-reference"
},
"refreshUrl": {
"type": "string",
"format": "uri-reference"
},
"scopes": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false
},
"Link": {
"type": "object",
"properties": {
"operationId": {
"type": "string"
},
"operationRef": {
"type": "string",
"format": "uri-reference"
},
"parameters": {
"type": "object",
"additionalProperties": {
}
},
"requestBody": {
},
"description": {
"type": "string"
},
"server": {
"$ref": "#/definitions/Server"
}
},
"patternProperties": {
"^x-": {
}
},
"additionalProperties": false,
"not": {
"description": "Operation Id and Operation Ref are mutually exclusive",
"required": [
"operationId",
"operationRef"
]
}
},
"Callback": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/PathItem"
},
"patternProperties": {
"^x-": {
}
}
},
"Encoding": {
"type": "object",
"properties": {
"contentType": {
"type": "string"
},
"headers": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Header"
}
},
"style": {
"type": "string",
"enum": [
"form",
"spaceDelimited",
"pipeDelimited",
"deepObject"
]
},
"explode": {
"type": "boolean"
},
"allowReserved": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
}
}
} OpenAPI-Specification-3.1.0/schemas/v3.0/schema.yaml 0000664 0000000 0000000 00000053051 14013016525 0021762 0 ustar 00root root 0000000 0000000 id: https://spec.openapis.org/oas/3.0/schema/2019-04-02
$schema: http://json-schema.org/draft-04/schema#
description: Validation schema for OpenAPI Specification 3.0.X.
type: object
required:
- openapi
- info
- paths
properties:
openapi:
type: string
pattern: ^3\.0\.\d(-.+)?$
info:
$ref: '#/definitions/Info'
externalDocs:
$ref: '#/definitions/ExternalDocumentation'
servers:
type: array
items:
$ref: '#/definitions/Server'
security:
type: array
items:
$ref: '#/definitions/SecurityRequirement'
tags:
type: array
items:
$ref: '#/definitions/Tag'
uniqueItems: true
paths:
$ref: '#/definitions/Paths'
components:
$ref: '#/definitions/Components'
patternProperties:
'^x-': {}
additionalProperties: false
definitions:
Reference:
type: object
required:
- $ref
patternProperties:
'^\$ref$':
type: string
format: uri-reference
Info:
type: object
required:
- title
- version
properties:
title:
type: string
description:
type: string
termsOfService:
type: string
format: uri-reference
contact:
$ref: '#/definitions/Contact'
license:
$ref: '#/definitions/License'
version:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
Contact:
type: object
properties:
name:
type: string
url:
type: string
format: uri-reference
email:
type: string
format: email
patternProperties:
'^x-': {}
additionalProperties: false
License:
type: object
required:
- name
properties:
name:
type: string
url:
type: string
format: uri-reference
patternProperties:
'^x-': {}
additionalProperties: false
Server:
type: object
required:
- url
properties:
url:
type: string
description:
type: string
variables:
type: object
additionalProperties:
$ref: '#/definitions/ServerVariable'
patternProperties:
'^x-': {}
additionalProperties: false
ServerVariable:
type: object
required:
- default
properties:
enum:
type: array
items:
type: string
default:
type: string
description:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
Components:
type: object
properties:
schemas:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
responses:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/Response'
parameters:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/Parameter'
examples:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/Example'
requestBodies:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/RequestBody'
headers:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/Header'
securitySchemes:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/SecurityScheme'
links:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/Link'
callbacks:
type: object
patternProperties:
'^[a-zA-Z0-9\.\-_]+$':
oneOf:
- $ref: '#/definitions/Reference'
- $ref: '#/definitions/Callback'
patternProperties:
'^x-': {}
additionalProperties: false
Schema:
type: object
properties:
title:
type: string
multipleOf:
type: number
minimum: 0
exclusiveMinimum: true
maximum:
type: number
exclusiveMaximum:
type: boolean
default: false
minimum:
type: number
exclusiveMinimum:
type: boolean
default: false
maxLength:
type: integer
minimum: 0
minLength:
type: integer
minimum: 0
default: 0
pattern:
type: string
format: regex
maxItems:
type: integer
minimum: 0
minItems:
type: integer
minimum: 0
default: 0
uniqueItems:
type: boolean
default: false
maxProperties:
type: integer
minimum: 0
minProperties:
type: integer
minimum: 0
default: 0
required:
type: array
items:
type: string
minItems: 1
uniqueItems: true
enum:
type: array
items: {}
minItems: 1
uniqueItems: false
type:
type: string
enum:
- array
- boolean
- integer
- number
- object
- string
not:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
allOf:
type: array
items:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
oneOf:
type: array
items:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
anyOf:
type: array
items:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
items:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
properties:
type: object
additionalProperties:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
additionalProperties:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
- type: boolean
default: true
description:
type: string
format:
type: string
default: {}
nullable:
type: boolean
default: false
discriminator:
$ref: '#/definitions/Discriminator'
readOnly:
type: boolean
default: false
writeOnly:
type: boolean
default: false
example: {}
externalDocs:
$ref: '#/definitions/ExternalDocumentation'
deprecated:
type: boolean
default: false
xml:
$ref: '#/definitions/XML'
patternProperties:
'^x-': {}
additionalProperties: false
Discriminator:
type: object
required:
- propertyName
properties:
propertyName:
type: string
mapping:
type: object
additionalProperties:
type: string
XML:
type: object
properties:
name:
type: string
namespace:
type: string
format: uri
prefix:
type: string
attribute:
type: boolean
default: false
wrapped:
type: boolean
default: false
patternProperties:
'^x-': {}
additionalProperties: false
Response:
type: object
required:
- description
properties:
description:
type: string
headers:
type: object
additionalProperties:
oneOf:
- $ref: '#/definitions/Header'
- $ref: '#/definitions/Reference'
content:
type: object
additionalProperties:
$ref: '#/definitions/MediaType'
links:
type: object
additionalProperties:
oneOf:
- $ref: '#/definitions/Link'
- $ref: '#/definitions/Reference'
patternProperties:
'^x-': {}
additionalProperties: false
MediaType:
type: object
properties:
schema:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
example: {}
examples:
type: object
additionalProperties:
oneOf:
- $ref: '#/definitions/Example'
- $ref: '#/definitions/Reference'
encoding:
type: object
additionalProperties:
$ref: '#/definitions/Encoding'
patternProperties:
'^x-': {}
additionalProperties: false
allOf:
- $ref: '#/definitions/ExampleXORExamples'
Example:
type: object
properties:
summary:
type: string
description:
type: string
value: {}
externalValue:
type: string
format: uri-reference
patternProperties:
'^x-': {}
additionalProperties: false
Header:
type: object
properties:
description:
type: string
required:
type: boolean
default: false
deprecated:
type: boolean
default: false
allowEmptyValue:
type: boolean
default: false
style:
type: string
enum:
- simple
default: simple
explode:
type: boolean
allowReserved:
type: boolean
default: false
schema:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
content:
type: object
additionalProperties:
$ref: '#/definitions/MediaType'
minProperties: 1
maxProperties: 1
example: {}
examples:
type: object
additionalProperties:
oneOf:
- $ref: '#/definitions/Example'
- $ref: '#/definitions/Reference'
patternProperties:
'^x-': {}
additionalProperties: false
allOf:
- $ref: '#/definitions/ExampleXORExamples'
- $ref: '#/definitions/SchemaXORContent'
Paths:
type: object
patternProperties:
'^\/':
$ref: '#/definitions/PathItem'
'^x-': {}
additionalProperties: false
PathItem:
type: object
properties:
$ref:
type: string
summary:
type: string
description:
type: string
servers:
type: array
items:
$ref: '#/definitions/Server'
parameters:
type: array
items:
oneOf:
- $ref: '#/definitions/Parameter'
- $ref: '#/definitions/Reference'
uniqueItems: true
patternProperties:
'^(get|put|post|delete|options|head|patch|trace)$':
$ref: '#/definitions/Operation'
'^x-': {}
additionalProperties: false
Operation:
type: object
required:
- responses
properties:
tags:
type: array
items:
type: string
summary:
type: string
description:
type: string
externalDocs:
$ref: '#/definitions/ExternalDocumentation'
operationId:
type: string
parameters:
type: array
items:
oneOf:
- $ref: '#/definitions/Parameter'
- $ref: '#/definitions/Reference'
uniqueItems: true
requestBody:
oneOf:
- $ref: '#/definitions/RequestBody'
- $ref: '#/definitions/Reference'
responses:
$ref: '#/definitions/Responses'
callbacks:
type: object
additionalProperties:
oneOf:
- $ref: '#/definitions/Callback'
- $ref: '#/definitions/Reference'
deprecated:
type: boolean
default: false
security:
type: array
items:
$ref: '#/definitions/SecurityRequirement'
servers:
type: array
items:
$ref: '#/definitions/Server'
patternProperties:
'^x-': {}
additionalProperties: false
Responses:
type: object
properties:
default:
oneOf:
- $ref: '#/definitions/Response'
- $ref: '#/definitions/Reference'
patternProperties:
'^[1-5](?:\d{2}|XX)$':
oneOf:
- $ref: '#/definitions/Response'
- $ref: '#/definitions/Reference'
'^x-': {}
minProperties: 1
additionalProperties: false
SecurityRequirement:
type: object
additionalProperties:
type: array
items:
type: string
Tag:
type: object
required:
- name
properties:
name:
type: string
description:
type: string
externalDocs:
$ref: '#/definitions/ExternalDocumentation'
patternProperties:
'^x-': {}
additionalProperties: false
ExternalDocumentation:
type: object
required:
- url
properties:
description:
type: string
url:
type: string
format: uri-reference
patternProperties:
'^x-': {}
additionalProperties: false
ExampleXORExamples:
description: Example and examples are mutually exclusive
not:
required: [example, examples]
SchemaXORContent:
description: Schema and content are mutually exclusive, at least one is required
not:
required: [schema, content]
oneOf:
- required: [schema]
- required: [content]
description: Some properties are not allowed if content is present
allOf:
- not:
required: [style]
- not:
required: [explode]
- not:
required: [allowReserved]
- not:
required: [example]
- not:
required: [examples]
Parameter:
type: object
properties:
name:
type: string
in:
type: string
description:
type: string
required:
type: boolean
default: false
deprecated:
type: boolean
default: false
allowEmptyValue:
type: boolean
default: false
style:
type: string
explode:
type: boolean
allowReserved:
type: boolean
default: false
schema:
oneOf:
- $ref: '#/definitions/Schema'
- $ref: '#/definitions/Reference'
content:
type: object
additionalProperties:
$ref: '#/definitions/MediaType'
minProperties: 1
maxProperties: 1
example: {}
examples:
type: object
additionalProperties:
oneOf:
- $ref: '#/definitions/Example'
- $ref: '#/definitions/Reference'
patternProperties:
'^x-': {}
additionalProperties: false
required:
- name
- in
allOf:
- $ref: '#/definitions/ExampleXORExamples'
- $ref: '#/definitions/SchemaXORContent'
- $ref: '#/definitions/ParameterLocation'
ParameterLocation:
description: Parameter location
oneOf:
- description: Parameter in path
required:
- required
properties:
in:
enum: [path]
style:
enum: [matrix, label, simple]
default: simple
required:
enum: [true]
- description: Parameter in query
properties:
in:
enum: [query]
style:
enum: [form, spaceDelimited, pipeDelimited, deepObject]
default: form
- description: Parameter in header
properties:
in:
enum: [header]
style:
enum: [simple]
default: simple
- description: Parameter in cookie
properties:
in:
enum: [cookie]
style:
enum: [form]
default: form
RequestBody:
type: object
required:
- content
properties:
description:
type: string
content:
type: object
additionalProperties:
$ref: '#/definitions/MediaType'
required:
type: boolean
default: false
patternProperties:
'^x-': {}
additionalProperties: false
SecurityScheme:
oneOf:
- $ref: '#/definitions/APIKeySecurityScheme'
- $ref: '#/definitions/HTTPSecurityScheme'
- $ref: '#/definitions/OAuth2SecurityScheme'
- $ref: '#/definitions/OpenIdConnectSecurityScheme'
APIKeySecurityScheme:
type: object
required:
- type
- name
- in
properties:
type:
type: string
enum:
- apiKey
name:
type: string
in:
type: string
enum:
- header
- query
- cookie
description:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
HTTPSecurityScheme:
type: object
required:
- scheme
- type
properties:
scheme:
type: string
bearerFormat:
type: string
description:
type: string
type:
type: string
enum:
- http
patternProperties:
'^x-': {}
additionalProperties: false
oneOf:
- description: Bearer
properties:
scheme:
enum: [bearer]
- description: Non Bearer
not:
required: [bearerFormat]
properties:
scheme:
not:
enum: [bearer]
OAuth2SecurityScheme:
type: object
required:
- type
- flows
properties:
type:
type: string
enum:
- oauth2
flows:
$ref: '#/definitions/OAuthFlows'
description:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
OpenIdConnectSecurityScheme:
type: object
required:
- type
- openIdConnectUrl
properties:
type:
type: string
enum:
- openIdConnect
openIdConnectUrl:
type: string
format: uri-reference
description:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
OAuthFlows:
type: object
properties:
implicit:
$ref: '#/definitions/ImplicitOAuthFlow'
password:
$ref: '#/definitions/PasswordOAuthFlow'
clientCredentials:
$ref: '#/definitions/ClientCredentialsFlow'
authorizationCode:
$ref: '#/definitions/AuthorizationCodeOAuthFlow'
patternProperties:
'^x-': {}
additionalProperties: false
ImplicitOAuthFlow:
type: object
required:
- authorizationUrl
- scopes
properties:
authorizationUrl:
type: string
format: uri-reference
refreshUrl:
type: string
format: uri-reference
scopes:
type: object
additionalProperties:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
PasswordOAuthFlow:
type: object
required:
- tokenUrl
properties:
tokenUrl:
type: string
format: uri-reference
refreshUrl:
type: string
format: uri-reference
scopes:
type: object
additionalProperties:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
ClientCredentialsFlow:
type: object
required:
- tokenUrl
properties:
tokenUrl:
type: string
format: uri-reference
refreshUrl:
type: string
format: uri-reference
scopes:
type: object
additionalProperties:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
AuthorizationCodeOAuthFlow:
type: object
required:
- authorizationUrl
- tokenUrl
properties:
authorizationUrl:
type: string
format: uri-reference
tokenUrl:
type: string
format: uri-reference
refreshUrl:
type: string
format: uri-reference
scopes:
type: object
additionalProperties:
type: string
patternProperties:
'^x-': {}
additionalProperties: false
Link:
type: object
properties:
operationId:
type: string
operationRef:
type: string
format: uri-reference
parameters:
type: object
additionalProperties: {}
requestBody: {}
description:
type: string
server:
$ref: '#/definitions/Server'
patternProperties:
'^x-': {}
additionalProperties: false
not:
description: Operation Id and Operation Ref are mutually exclusive
required: [operationId, operationRef]
Callback:
type: object
additionalProperties:
$ref: '#/definitions/PathItem'
patternProperties:
'^x-': {}
Encoding:
type: object
properties:
contentType:
type: string
headers:
type: object
additionalProperties:
$ref: '#/definitions/Header'
style:
type: string
enum:
- form
- spaceDelimited
- pipeDelimited
- deepObject
explode:
type: boolean
allowReserved:
type: boolean
default: false
additionalProperties: false
OpenAPI-Specification-3.1.0/scripts/ 0000775 0000000 0000000 00000000000 14013016525 0017210 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/scripts/yaml2json/ 0000775 0000000 0000000 00000000000 14013016525 0021126 5 ustar 00root root 0000000 0000000 OpenAPI-Specification-3.1.0/scripts/yaml2json/yaml2json.js 0000775 0000000 0000000 00000001202 14013016525 0023400 0 ustar 00root root 0000000 0000000 #!/usr/bin/env node
'use strict';
const fs = require('fs');
const yaml = require('yaml');
function convert(filename) {
console.log(filename);
const s = fs.readFileSync(filename,'utf8');
let obj;
try {
obj = yaml.parse(s, {prettyErrors: true});
fs.writeFileSync(filename.replace('.yaml','.json'),JSON.stringify(obj,null,2),'utf8');
}
catch (ex) {
console.warn(' ',ex.message);
process.exitCode = 1;
}
}
if (process.argv.length<3) {
console.warn('Usage: yaml2json {infiles}');
}
else {
for (let i=2;i