diff --git a/.travis.yml b/.travis.yml
index ceb7fef10c..37727967b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,18 @@
sudo: false
-language: scala
-scala:
- - 2.10.4
script:
- npm install
- - npm test
- - sbt ++$TRAVIS_SCALA_VERSION test
+env:
+ - VALIDATORS=tv4
+ - VALIDATORS=zschema
+matrix:
+ allow_failures:
+ - env: VALIDATORS=tv4
+install:
+ - rm -rf ~/.nvm
+ - curl -L https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh
+ - source ~/.nvm/nvm.sh
+ - nvm install 6.1
+ - nvm use 6.1
+script:
+ - npm install
+ - node node_modules/mdv/mdv versions/3.*.md
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
new file mode 100644
index 0000000000..817f37a53d
--- /dev/null
+++ b/CONTRIBUTORS.md
@@ -0,0 +1,9 @@
+* 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)
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
new file mode 100644
index 0000000000..698eccfb69
--- /dev/null
+++ b/DEVELOPMENT.md
@@ -0,0 +1,56 @@
+## Development Guidelines
+
+This document intends to establish guidelines which build a transparent, open mechanism for deciding how to evolve the OpenAPI Specification. The Open API Technical Developer Community will initially follow these processes when merging changes from external contributors or from the TDC 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 change_ from the original 2.0 version. We should typically make changes 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.
+
+
+## Tracking Process
+
+ - Use GitHub for all spec designs, use cases, and so on.
+ - As with 2.0, the **human readable** document is the source of truth. If using a JSON Schema again to document the spec, it is secondary to the human documentation. The documentation should live in a *.md file, in parallel to the 2.0 document (versions/3.0.0.md for example).
+ - 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` - 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`, `needs migration review`, `needs tooling review`, `needs documentation`, `rejected`, and `needs approval`. These labels must be assigned by project committers.
+ - An issue will be opened for each feature change. Embedded in the issue, or ideally linked in a file via pull-request (PR), a document about use cases should be supplied with the change.
+ - A PR will be used to describe the _proposed_ solution, and linked to the original issue.
+ - Not all committers will contribute to every single proposed change. There may be many open proposals at once, and multiple efforts may happen in parallel.
+ - When the a work branch is ready and approved, the branch will be merged to master.
+
+## Approving Changes
+
+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, and spec generation techniques. Some features may be impossible to support in different frameworks/languages. These should be documented and considered during the change approval process.
+ - Visualization. Can the specification change be graphically visualized somehow in a UI or other interface?
+
+Spec changes should be approved by a majority of the committers. Approval can be given by commenting on the issue itself, for example, "Approved by @fehguy". After voting criteria is met, any committer can merge the PR. (**TODO**: we will want to formalize what voting criteria actually is).
+
+No change should be approved until there is documentation for it, supplied in an accompanying PR.
+
+## Transparency
+
+We should always be as transparent as possible. Sometimes there will be discussions that use customer names, sensitive use cases, and so on. These must be anonymized, discussed in a private repository, or conducted offline.
+
+ - Asynchronous discussions should live in the GitHub issues for this project.
+ - Realtime discussions should be in a public chat such as IRC or Slack.
+
diff --git a/IMPLEMENTATIONS.md b/IMPLEMENTATIONS.md
new file mode 100644
index 0000000000..96a2a2d6c1
--- /dev/null
+++ b/IMPLEMENTATIONS.md
@@ -0,0 +1,47 @@
+### 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 necessarily endorsed by the OAI.
+
+#### Low-Level tooling
+
+| Title | Project Link | Language |Description |
+|----------------|--------------|----------|---------------------|
+| swagger-parser | [GitHub/swagger-api](https://github.com/swagger-api/swagger-parser/tree/feature/3.0.0-rc0) | Java | Swagger 1.0, 1.1, 1.2, 2.0 to Open API Specification converter |
+| swagger-models | [GitHub/swagger-api](https://github.com/swagger-api/swagger-core/tree/feature/3.0.0-rc0/modules/swagger-models) | Java | Open API 3.0 Java Pojos |
+| KaiZen OpenAPI Parser | [GitHub/RepreZen/KaiZen-OpenAPI-Parser](https://github.com/RepreZen/KaiZen-OpenAPI-Parser) | Java | High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x |
+| openapi3-ts | [GitHub/metadevpro/openapi3-ts](https://github.com/metadevpro/openapi3-ts) | TypeScript | TS Model & utils for OpenAPI 3.0.x contracts |
+| swagger2openapi | [GitHub/mermade/swagger2openapi](https://github.com/mermade/swagger2openapi) | Node.js | An OpenAPI / Swagger 2.0 to OpenAPI 3.0.x converter and validator |
+| Tavis.OpenApi | [GitHub/tavis-sofware/Tavis.OpenApi](https://github.com/tavis-software/Tavis.OpenApi/) | dotnet | C# based parser with definition validation and migration support from V2 |
+| odata-openapi | [GitHub/oasis-tcs/odata-openapi](https://github.com/oasis-tcs/odata-openapi) | XSLT | OData 4.0 to OpenAPI 3.0.0 converter |
+
+
+#### Editors
+
+| Title | Project Link | Language |Description |
+|----------------|--------------|----------|---------------------|
+| KaiZen OpenAPI Editor | [GitHub/RepreZen/KaiZen-OpenAPI-Editor](https://github.com/RepreZen/KaiZen-OpenAPI-Editor) | Java | Eclipse Editor for OpenAPI 2.0 and 3.0 |
+| RepreZen API Studio | [RepreZen.com/OpenAPI](https://www.reprezen.com/OpenAPI) | Java | Commercial desktop IDE for API design, documentation & development |
+| OpenApi-gui | [GitHub/Mermade/openapi-gui](https://github.com/Mermade/openapi-gui) | Node.js | GUI / visual editor for creating and editing OpenApi / Swagger definitions |
+| 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 |
+
+#### 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 Open API v3 |
+
+
+#### Server Implementations
+
+
+#### Code Generators
+
+| Title | Project Link | Language |Description |
+|----------------|--------------|----------|---------------------|
+| baucis-openapi3 | [Github/metadevpro/baucis-openapi3](https://github.com/metadevpro/baucis-openapi3) | Node.js | [Baucis.js](https://github.com/wprl/baucis) plugin for generating OpenAPI 3.0 compliant API contracts. |
+| Google Gnostic | [GitHub/googleapis/gnostic](https://github.com/googleapis/gnostic) | Go | Compile OpenAPI descriptions into equivalent Protocol Buffer representations. |
+| 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 |
diff --git a/LICENSE b/LICENSE
index 08ec3d307e..8d9ebfcb19 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2016 The Linux Foundation
+Copyright 2017 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.
diff --git a/README.md b/README.md
index c644ab7cf4..f2f1f82cd4 100644
--- a/README.md
+++ b/README.md
@@ -1,68 +1,64 @@
-# The OpenAPI Specification (fka The Swagger Specification)
+# The OpenAPI Specification
[](https://travis-ci.org/OAI/OpenAPI-Specification)

-**The OAS 3.0.0-RC0 Spec can be [found here](https://github.com/OAI/OpenAPI-Specification/blob/3.0.0-rc0/versions/3.0.md)**
+The OpenAPI Specification is a community driven, open specification within the [Open API Initiative](https://www.openapis.org/), a Linux Foundation Collaborative Project.
-The goal of The OpenAPI Specification is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, OpenAPI removes the guesswork in calling the service.
+The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for REST APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.
-Use cases for machine-readable API interfaces include interactive documentation, code generation for documentation, client, and server, as well as automated test cases. OpenAPI-enabled APIs expose JSON files that correctly adhere to the OpenAPI Specification, documented in this repository. These files can either be produced and served statically, or be generated dynamically from your application.
+Use cases for machine-readable API definition documents include, but are not limited to, interactive documentation; code generation for documentation, clients, and servers; and automation of test cases. OpenAPI documents describe an API's services and are represented in either YAML or JSON formats. These documents may either be produced and served statically or be generated dynamically from an application.
-Without going into a long history of interfaces to Web Services, this is not the first attempt to do so. We can learn from CORBA, WSDL and WADL. These specifications had good intentions but were limited by proprietary vendor-specific implementations, being bound to a specific programming language, and goals which were too open-ended. In the end, they failed to gain traction.
-
-OpenAPI does not require you to rewrite your existing API. It does not require binding any software to a service--the service being described may not even be yours. 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 use-case of a REST-ful API. OpenAPI does not define a specific development process such as design-first or code-first. It does facilitate either technique by establishing clear interactions with a REST API.
+The OpenAPI Specification does not require rewriting existing APIs. It does not require binding any software to a service—the service being described may not even be owned by the creator of its description. It does, however, require the capabilities of the service be described in the structure of the OpenAPI Specification. Not all services can be described by OpenAPI—this specification is not intended to cover every possible style of REST APIs. The OpenAPI Specification does not mandate a specific development process such as design-first or code-first. It does facilitate either technique by establishing clear interactions with a REST API.
This GitHub project is the starting point for OpenAPI.
-Here you will find the information you need about the OpenAPI Specification, a simple static sample of what it looks like,
-and some general information regarding the project.
+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.0
-## Current Version - 2.0
+The current version of the OpenAPI specification is [OpenAPI Specification 3.0](versions/3.0.0.md).
-The current version of the OpenAPI specification is 2.0 - and you can find it [here](versions/2.0.md).
+### Future Versions
-### [OpenAPI 2.0 Specification](versions/2.0.md)
+[3.0.1](https://github.com/OAI/OpenAPI-Specification/tree/v3.0.1) - The next PATCH version. Patch-level fixes (typos, clarifications, etc.) should be submitted against this branch.
-This repository contains the existing Swagger 1.2, 2.0 specifications as well as proposals for the next version of the specification, which will be called the OpenAPI Specification 3.0. The proposals live in the [OpenAPI.next](https://github.com/OAI/OpenAPI-Specification/tree/OpenAPI.next) branch.
+### Previous Versions
-## Structure
+This repository also contains the [OpenAPI Specification 2.0](versions/2.0.md), which is identical to the Swagger 2.0 specification before it was renamed to “OpenAPI Specification”,
+as well as the Swagger 1.2 and Swagger 2.0 specifications.
-Each section should contain v1.2 and v2.0 folders to avoid confusion between the 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.
-Please keep in mind that the other projects under OpenAPI use an independent version system.
-As such, don't confuse the version of the OpenAPI Specification they support and the version of that given library.
+## See It in Action
-## The Wiki
+If you just want to see it work, check out the [list of current examples](examples/v3.0).
-Check out the [wiki](https://github.com/OAI/OpenAPI-Specification/wiki) for additional and relevant information about the project.
+## Tools and Libraries
-This includes:
-- Static sample tutorial.
-- List of known deployments.
-- Revision history.
+Looking to see how you can create your own OpenAPI definition, present it, or otherwise use it? Check out the growing
+[list of 3.0 Implementations](IMPLEMENTATIONS.md).
-## See it in Action
+## Participation
-If you just want to see it work, check out the [pet store sample](http://petstore.swagger.io/).
+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 Developer Community](https://www.openapis.org/participate/how-to-contribute/governance#TDC). This group of committers bring their API expertise, incorporate feedback from the community, and expand the group of committers as appropriate. All development activity on the future specification will be performed as features and merged into this branch. Upon release of the future specification, this branch will be merged to master.
-## Tools and Libraries
+The Open API Initiative encourages participation from individuals and companies alike.
+If you want to participate in the evolution of the OpenAPI Specification, consider taking the following actions:
-Looking to see how you can create your own OpenAPI definition, present it or otherwise use it? Check out our [list of tools](http://swagger.io/open-source-integrations/) over at [http://swagger.io](http://swagger.io/open-source-integrations/).
+* Review the [current specification](versions/3.0.0.md). The human-readable markdown file _is the source of truth_ for the specification.
+* Review the [development](DEVELOPMENT.md) process so you understand how the spec is evolving.
+* Check the [issues](https://github.com/OAI/OpenAPI-Specification/issues) and [pull requests](https://github.com/OAI/OpenAPI-Specification/pulls) to see if someone has already documented your idea or feedback on the specification. You can follow an existing conversation by adding a comment to the existing issue or PR.
+* Create an issue to describe a new concern. If possible, propose a solution.
-(Yes, there used to be a really long list here, we just moved it to the main website)
+Not all feedback can be accommodated and there may be solid arguments for or against a change being appropriate for the specification.
## License
-Copyright 2016 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 [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
+See: [License (Apache-2.0)](https://github.com/OAI/OpenAPI-Specification/blob/master/LICENSE)
+
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+
diff --git a/build.sbt b/build.sbt
deleted file mode 100644
index 0a1a11a1e3..0000000000
--- a/build.sbt
+++ /dev/null
@@ -1,9 +0,0 @@
-name := "schema-test"
-
-scalaVersion := "2.10.4"
-
-libraryDependencies ++= Seq(
- "com.github.fge" % "json-schema-validator" % "2.2.5",
- "junit" % "junit" % "4.8.1" % "test",
- "org.scalatest" %% "scalatest" % "1.9.2" % "test"
-)
diff --git a/examples/v3.0/api-with-examples.yaml b/examples/v3.0/api-with-examples.yaml
new file mode 100644
index 0000000000..dd42b0e959
--- /dev/null
+++ b/examples/v3.0/api-with-examples.yaml
@@ -0,0 +1,167 @@
+openapi: "3.0.0"
+info:
+ title: Simple API overview
+ version: v2
+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"
+ }
+ ]
+ }
+ }
diff --git a/examples/v3.0/callback-example.yaml b/examples/v3.0/callback-example.yaml
new file mode 100644
index 0000000000..56ab18e27d
--- /dev/null
+++ b/examples/v3.0/callback-example.yaml
@@ -0,0 +1,57 @@
+# ...
+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:
+ 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
diff --git a/examples/v3.0/link-example.yaml b/examples/v3.0/link-example.yaml
new file mode 100644
index 0000000000..5837d705ee
--- /dev/null
+++ b/examples/v3.0/link-example.yaml
@@ -0,0 +1,203 @@
+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'
diff --git a/examples/v3.0/petstore-expanded.yaml b/examples/v3.0/petstore-expanded.yaml
new file mode 100644
index 0000000000..e8c0fe5ffd
--- /dev/null
+++ b/examples/v3.0/petstore-expanded.yaml
@@ -0,0 +1,155 @@
+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: foo@example.com
+ url: http://madskristensen.net
+ license:
+ name: MIT
+ url: http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
+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'
+ - required:
+ - id
+ properties:
+ id:
+ type: integer
+ format: int64
+
+ NewPet:
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ tag:
+ type: string
+
+ Error:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
diff --git a/examples/v3.0/petstore.yaml b/examples/v3.0/petstore.yaml
new file mode 100644
index 0000000000..5fdfba907d
--- /dev/null
+++ b/examples/v3.0/petstore.yaml
@@ -0,0 +1,109 @@
+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: An 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/Pets"
+ default:
+ description: unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+components:
+ schemas:
+ Pet:
+ required:
+ - id
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ tag:
+ type: string
+ Pets:
+ type: array
+ items:
+ $ref: "#/components/schemas/Pet"
+ Error:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
diff --git a/examples/v3.0/uber.yaml b/examples/v3.0/uber.yaml
new file mode 100644
index 0000000000..8b94db300f
--- /dev/null
+++ b/examples/v3.0/uber.yaml
@@ -0,0 +1,297 @@
+# this is an example of the Uber API
+# as a demonstration of an API spec in YAML
+openapi: "3.0.0"
+info:
+ title: Uber API
+ description: Move your app forward with the Uber API
+ version: "1.0.0"
+servers:
+ - url: https://api.uber.com/v1
+paths:
+ /products:
+ get:
+ summary: Product Types
+ description: The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.
+ parameters:
+ - name: latitude
+ in: query
+ description: Latitude component of location.
+ required: true
+ schema:
+ type: number
+ format: double
+ - name: longitude
+ in: query
+ description: Longitude component of location.
+ required: true
+ schema:
+ type: number
+ format: double
+ security:
+ - apikey: []
+ tags:
+ - Products
+ responses:
+ '200':
+ description: An array of products
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ProductList"
+ default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ /estimates/price:
+ get:
+ summary: Price Estimates
+ description: The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.
The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.
+ parameters:
+ - name: start_latitude
+ in: query
+ description: Latitude component of start location.
+ required: true
+ schema:
+ type: number
+ format: double
+ - name: start_longitude
+ in: query
+ description: Longitude component of start location.
+ required: true
+ schema:
+ type: number
+ format: double
+ - name: end_latitude
+ in: query
+ description: Latitude component of end location.
+ required: true
+ schema:
+ type: number
+ format: double
+ - name: end_longitude
+ in: query
+ description: Longitude component of end location.
+ required: true
+ schema:
+ type: number
+ format: double
+ tags:
+ - Estimates
+ responses:
+ '200':
+ description: An array of price estimates by product
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/PriceEstimate"
+ default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ /estimates/time:
+ get:
+ summary: Time Estimates
+ description: The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.
+ parameters:
+ - name: start_latitude
+ in: query
+ description: Latitude component of start location.
+ required: true
+ schema:
+ type: number
+ format: double
+ - name: start_longitude
+ in: query
+ description: Longitude component of start location.
+ required: true
+ schema:
+ type: number
+ format: double
+ - name: customer_uuid
+ in: query
+ schema:
+ type: string
+ format: uuid
+ description: Unique customer identifier to be used for experience customization.
+ - name: product_id
+ in: query
+ schema:
+ type: string
+ description: Unique identifier representing a specific product for a given latitude & longitude.
+ tags:
+ - Estimates
+ responses:
+ '200':
+ description: An array of products
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: "#/components/schemas/Product"
+ default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ /me:
+ get:
+ summary: User Profile
+ description: The User Profile endpoint returns information about the Uber user that has authorized with the application.
+ tags:
+ - User
+ responses:
+ '200':
+ description: Profile information for a user
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Profile"
+ default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ /history:
+ get:
+ summary: User Activity
+ description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.
The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
+ parameters:
+ - name: offset
+ in: query
+ schema:
+ type: integer
+ format: int32
+ description: Offset the list of returned results by this amount. Default is zero.
+ - name: limit
+ in: query
+ schema:
+ type: integer
+ format: int32
+ description: Number of items to retrieve. Default is 5, maximum is 100.
+ tags:
+ - User
+ responses:
+ '200':
+ description: History information for the given user
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Activities"
+ default:
+ description: Unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+components:
+ securitySchemes:
+ apikey:
+ type: apiKey
+ name: server_token
+ in: query
+ schemas:
+ Product:
+ properties:
+ product_id:
+ type: string
+ description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
+ description:
+ type: string
+ description: Description of product.
+ display_name:
+ type: string
+ description: Display name of product.
+ capacity:
+ type: integer
+ description: Capacity of product. For example, 4 people.
+ image:
+ type: string
+ description: Image URL representing the product.
+ ProductList:
+ properties:
+ products:
+ description: Contains the list of products
+ type: array
+ items:
+ $ref: "#/components/schemas/Product"
+ PriceEstimate:
+ properties:
+ product_id:
+ type: string
+ description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles
+ currency_code:
+ type: string
+ description: "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code."
+ display_name:
+ type: string
+ description: Display name of product.
+ estimate:
+ type: string
+ description: Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI.
+ low_estimate:
+ type: number
+ description: Lower bound of the estimated price.
+ high_estimate:
+ type: number
+ description: Upper bound of the estimated price.
+ surge_multiplier:
+ type: number
+ description: Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
+ Profile:
+ properties:
+ first_name:
+ type: string
+ description: First name of the Uber user.
+ last_name:
+ type: string
+ description: Last name of the Uber user.
+ email:
+ type: string
+ description: Email address of the Uber user
+ picture:
+ type: string
+ description: Image URL of the Uber user.
+ promo_code:
+ type: string
+ description: Promo code of the Uber user.
+ Activity:
+ properties:
+ uuid:
+ type: string
+ description: Unique identifier for the activity
+ Activities:
+ properties:
+ offset:
+ type: integer
+ format: int32
+ description: Position in pagination.
+ limit:
+ type: integer
+ format: int32
+ description: Number of items to retrieve (100 max).
+ count:
+ type: integer
+ format: int32
+ description: Total number of items available.
+ history:
+ type: array
+ items:
+ $ref: "#/components/schemas/Activity"
+ Error:
+ properties:
+ code:
+ type: string
+ message:
+ type: string
+ fields:
+ type: string
+
diff --git a/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions_part1.json b/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions_part1.json
index 127973717b..a79ee51499 100644
--- a/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions_part1.json
+++ b/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions_part1.json
@@ -24,13 +24,13 @@
"200": {
"description": "pet response",
"schema": {
- "$ref": "#/definitions/Pet"
+ "$ref": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions.json#/definitions/Pet"
}
},
"default": {
"description": "error payload",
"schema": {
- "$ref": "#/definitions/ErrorModel"
+ "$ref": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions.json#/definitions/ErrorModel"
}
}
}
diff --git a/guidelines/EXTENSIONS.md b/guidelines/EXTENSIONS.md
index c0ead4be21..2bddf6fd9b 100644
--- a/guidelines/EXTENSIONS.md
+++ b/guidelines/EXTENSIONS.md
@@ -1,92 +1 @@
-# Swagger Extensions
-
-The Swagger 2.0 specification allows for custom properties to be added at several places within a Swagger definition, 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](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#info-object)
-* within the [paths object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#paths-object)
-* within the [path-item object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#path-item-object)
-* within the [operation object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#operationObject)
-* within the [parameter object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parameterObject)
-* within the [responses object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#responses-object)
-* within the [tag object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#tag-object)
-* within the [security-scheme object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#security-scheme-object)
-
-For example, a vendor extension that adds apis.json specific metadata a Swagger 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 swagger definitions, the advantage being that all metadata
-for a Swagger 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 Swagger specific annotations currently available for jax-rs APIs do not support the addition of extension data.
+For OpenAPI Specification version 2.0, please see [v2.0/EXTENSIONS.md](v2.0/EXTENSIONS.md)
diff --git a/guidelines/README.md b/guidelines/README.md
deleted file mode 100644
index b18a2a2b1d..0000000000
--- a/guidelines/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## Guidelines for Swagger definitions
-
-* [Reuse](REUSE.md) of Swagger definitions
-* [Extending](EXTENSIONS.md) Swagger definitions with custom metadata
diff --git a/guidelines/sample-server/README.md b/guidelines/sample-server/README.md
deleted file mode 100644
index c3f5c16f4d..0000000000
--- a/guidelines/sample-server/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-### Running the sample server
-
-```bash
-npm install
-node server.js
-```
diff --git a/guidelines/sample-server/files/models.json b/guidelines/sample-server/files/models.json
deleted file mode 100644
index 4cb68ebf40..0000000000
--- a/guidelines/sample-server/files/models.json
+++ /dev/null
@@ -1,108 +0,0 @@
-{
- "Model": {
- "type": "object",
- "description": "A simple model",
- "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": {
- "type": "object",
- "description": "A tag entity in the system",
- "properties": {
- "name": {
- "type": "string"
- }
- }
- },
- "Health": {
- "type": "object",
- "description": "An object representing the health of a server",
- "required": [
- "liveThreadCount",
- "peakThreadCount",
- "startedThreadCount",
- "daemonThreadCount",
- "jvmMemory"
- ],
- "properties": {
- "liveThreadCount": {
- "type": "integer",
- "format": "int32"
- },
- "peakThreadCount": {
- "type": "integer",
- "format": "int32"
- },
- "startedThreadCount": {
- "type": "integer",
- "format": "int32"
- },
- "daemonThreadCount": {
- "type": "integer",
- "format": "int32"
- },
- "jvmMemory": {
- "$ref": "http://localhost:8000/models.json#/JVMMemory"
- }
- }
- },
- "JVMMemory": {
- "type": "object",
- "required": [
- "allocated",
- "max",
- "free",
- "used",
- "percentUsed"
- ],
- "properties": {
- "allocated": {
- "type": "integer",
- "format": "int64"
- },
- "max": {
- "type": "integer",
- "format": "int64"
- },
- "free": {
- "type": "integer",
- "format": "int64"
- },
- "used": {
- "type": "integer",
- "format": "int64"
- },
- "percentUsed": {
- "type": "number",
- "format": "double"
- }
- }
- },
- "ErrorMessage": {
- "type": "object",
- "description": "A shared model for error message",
- "required" : ["errorCode","reason"],
- "properties": {
- "errorCode": {
- "type": "integer",
- "format": "int64"
- },
- "reason": {
- "description": "the reason for this error",
- "type": "string"
- },
- "description": {
- "description": "an optional longer description of this error message",
- "type": "string"
- }
- }
- }
-}
diff --git a/guidelines/sample-server/files/operations.json b/guidelines/sample-server/files/operations.json
deleted file mode 100644
index 5d646682de..0000000000
--- a/guidelines/sample-server/files/operations.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "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"
- }
- },
- "404": {
- "$ref": "http://localhost:8000/responses.json#/NotFoundError"
- }
- }
- }
- }
-}
-
diff --git a/guidelines/sample-server/files/parameters.json b/guidelines/sample-server/files/parameters.json
deleted file mode 100644
index bbaa056585..0000000000
--- a/guidelines/sample-server/files/parameters.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "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"
- }
- }
-}
\ No newline at end of file
diff --git a/guidelines/sample-server/files/responses.json b/guidelines/sample-server/files/responses.json
deleted file mode 100644
index 95ece33eb3..0000000000
--- a/guidelines/sample-server/files/responses.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "NotFoundError": {
- "description": "Entity not found",
- "schema": {
- "$ref": "http://localhost:8000/models.json#/ErrorMessage"
- }
- }
-}
\ No newline at end of file
diff --git a/guidelines/sample-server/files/swagger.json b/guidelines/sample-server/files/swagger.json
deleted file mode 100644
index e7f4c08992..0000000000
--- a/guidelines/sample-server/files/swagger.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "swagger": "2.0",
- "info": {
- "description": "Sample server to demonstrate object reuse",
- "version": "1.0.0",
- "title": "Swagger sample"
- },
- "paths": {
- "/health": {
- "$ref": "http://localhost:8000/operations.json#/health"
- },
- "/users": {
- "get": {
- "tags": [
- "users"
- ],
- "summary": "Returns users in the system",
- "operationId": "getUsers",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "$ref": "http://localhost:8000/parameters.json#/query/skip"
- },
- {
- "$ref": "http://localhost:8000/parameters.json#/query/limit"
- }
- ],
- "responses": {
- "200": {
- "description": "Users in the system",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "http://localhost:8000/models.json#/Health"
- }
- }
- },
- "404": {
- "$ref": "http://localhost:8000/responses.json#/NotFoundError"
- }
- }
- }
- }
- }
-}
diff --git a/guidelines/sample-server/package.json b/guidelines/sample-server/package.json
deleted file mode 100644
index fdb98a1a14..0000000000
--- a/guidelines/sample-server/package.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "version": "0.0.1",
- "author": {
- "name": "Tony Tam",
- "email": "fehguy@gmail.com",
- "url": "https://github.com/fehguy"
- },
- "dependencies": {
- "cors": "^2.5.3",
- "http-server": "0.8.0"
- }
-}
diff --git a/guidelines/sample-server/server.js b/guidelines/sample-server/server.js
deleted file mode 100644
index b70eba0e21..0000000000
--- a/guidelines/sample-server/server.js
+++ /dev/null
@@ -1,6 +0,0 @@
-var fs = require('fs');
-var createServer = require('http-server').createServer;
-
-var server = createServer({ root: 'files', cors: true });
-
-server.listen(8000);
diff --git a/guidelines/v2.0/EXTENSIONS.md b/guidelines/v2.0/EXTENSIONS.md
new file mode 100644
index 0000000000..e0c1124034
--- /dev/null
+++ b/guidelines/v2.0/EXTENSIONS.md
@@ -0,0 +1,92 @@
+# 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.
diff --git a/guidelines/v2.0/README.md b/guidelines/v2.0/README.md
new file mode 100644
index 0000000000..4b1bea7f98
--- /dev/null
+++ b/guidelines/v2.0/README.md
@@ -0,0 +1,4 @@
+## Guidelines for OpenAPI Definitions
+
+* [Reuse](REUSE.md) of OpenAPI definitions
+* [Extending](EXTENSIONS.md) OpenAPI definitions with custom metadata
diff --git a/guidelines/REUSE.md b/guidelines/v2.0/REUSE.md
similarity index 100%
rename from guidelines/REUSE.md
rename to guidelines/v2.0/REUSE.md
diff --git a/gulpfile.js b/gulpfile.js
deleted file mode 100644
index 261b0b6286..0000000000
--- a/gulpfile.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var gulp = require('gulp');
-
-var jsonlint = require("gulp-jsonlint");
-var gulpyaml = require('gulp-yaml');
-var ext_replace = require('gulp-ext-replace');
-var map = require('map-stream');
-var YAML = require('json2yaml');
-var gutil = require('gulp-util');
-
-var exitCode = 0;
-
-var json_paths = {
- examples: 'examples/**/*.json',
- models: 'fixtures/v2.0/json/models/**/*.json',
- resources: 'fixtures/v2.0/json/resources/**/*.json',
- responses: 'fixtures/v2.0/json/responses/**/*.json'
- // What are the other files in fixtures/v2.0/json/*.json
-};
-
-gulp.task('lint', function() {
- return gulp.src(['./**/*.json', '!./node_modules/**/*.json'])
- .pipe(jsonlint())
- .pipe(jsonlint.reporter());
-
- // YAML linting/formatting?
-});
-
-gulp.task('yaml2json', function(){
- gulp.src('./fixtures/v2.0/yaml/**.yaml')
- .pipe(gulpyaml({ pretty: true }))
- .pipe(gulp.dest('./fixtures/v2.0/json'));
-
- gulp.src(json_paths.examples)
- .pipe(gulpyaml({ pretty: true }))
- .pipe(gulp.dest('examples/'));
-});
-
-gulp.task('json2yaml', function(){
- return gulp.src('./fixtures/v2.0/json/**/*.json')
- .pipe(map(function(file, cb) {
- data = JSON.parse(file.contents);
- file.contents = new Buffer(String(YAML.stringify(data)));
- cb(null, file);
- }))
- .pipe(ext_replace('.yaml'))
- .pipe(gulp.dest('fixtures/v2.0/yaml'));
-});
-
diff --git a/package.json b/package.json
index b182b8483b..a5b8cd1873 100644
--- a/package.json
+++ b/package.json
@@ -1,24 +1,33 @@
{
- "private": true,
- "scripts": {
- "test": "gulp lint && mocha"
+ "name": "swagger-validator",
+ "version": "0.0.1",
+ "description": "validates a file",
+ "author": {
+ "name": "Tony Tam",
+ "email": "fehguy@gmail.com",
+ "url": "http://swagger.io"
+ },
+ "license": "Apache",
+ "readmeFilename": "README.md",
+ "dependencies": {
+ "tv4": "~1.1.x",
+ "chai": "1.9.x"
},
- "dependencies": {},
"devDependencies": {
- "chai": "^3.5.0",
- "glob": "^7.0.0",
+ "glob": "^4.0.5",
"gulp": "~3.8.x",
"gulp-ext-replace": "^0.1.0",
"gulp-jsonlint": "0.0.3",
"gulp-util": "^3.0.0",
"gulp-yaml": "0.0.3",
"js-yaml": "^3.1.0",
- "json-schema-ref-parser": "^2.2.0",
"json2yaml": "^1.0.3",
"jsonschema": "^1.0.0",
- "lodash": "^4.5.1",
"map-stream": "^0.1.0",
- "mocha": "^2.4.5",
- "z-schema": "^3.16.1"
+ "mdv": "^1.0.3",
+ "mocha": "^1.21.3",
+ "q": "^1.0.1",
+ "request": "^2.39.0",
+ "z-schema": "^2.4.9"
}
}
diff --git a/schemas/v2.0/schema.json b/schemas/v2.0/schema.json
index f12a8c0e47..a92e18f2a5 100644
--- a/schemas/v2.0/schema.json
+++ b/schemas/v2.0/schema.json
@@ -203,7 +203,7 @@
"additionalProperties": {
"$ref": "#/definitions/response"
},
- "description": "One or more JSON representations for parameters"
+ "description": "One or more JSON representations for responses"
},
"externalDocs": {
"type": "object",
diff --git a/src/main/javascript/server.js b/src/main/javascript/server.js
deleted file mode 100644
index 1f067b80b0..0000000000
--- a/src/main/javascript/server.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var fs = require('fs'),
- http = require('http');
-
-http.createServer(function (req, res) {
- fs.readFile("./schemas/v2.0" + req.url, function (err,data) {
- if (err) {
- res.writeHead(404);
- res.end(JSON.stringify(err));
- return;
- }
- res.writeHead(200);
- res.end(data);
- });
-}).listen(8000);
\ No newline at end of file
diff --git a/src/test/scala/GeneralTest.scala b/src/test/scala/GeneralTest.scala
deleted file mode 100644
index 2f3925364f..0000000000
--- a/src/test/scala/GeneralTest.scala
+++ /dev/null
@@ -1,79 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class InfoTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("info"))
-
- // Info Object Tests - Positive
-
- it should "validate a basic info object" in {
- val json = Source.fromFile("fixtures/v2.0/json/general/basicInfoObject.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a minimal info object" in {
- val json = Source.fromFile("fixtures/v2.0/json/general/minimalInfoObject.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- // Info Object (+ License Object) Tests - Negative
-
- it should "not validate an info object with missing required fields" in {
- val json = Source.fromFile("fixtures/v2.0/json/general/negative/negativeInfoObject.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == true)
- println(report)
- report.isSuccess should be (false)
- }
-}
-
-@RunWith(classOf[JUnitRunner])
-class ExternalDocsTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("externalDocs"))
-
- // externalDocs - Positive
-
- it should "validate an externalDocs object" in {
- val json = Source.fromFile("fixtures/v2.0/json/general/externalDocs.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- // externalDocs - Negative
-
- it should "not validate an externalDocs with missing required fields" in {
- val json = Source.fromFile("fixtures/v2.0/json/general/negative/negativeExternalDocs.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == true)
- println(report)
- report.isSuccess should be (false)
- }
-}
diff --git a/src/test/scala/ModelTest.scala b/src/test/scala/ModelTest.scala
deleted file mode 100644
index 94d179dcf7..0000000000
--- a/src/test/scala/ModelTest.scala
+++ /dev/null
@@ -1,73 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class ModelTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("schema"))
-
- it should "validate a model with string property" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithStringProperty.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a model with multiple properties" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithMultipleProperties.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a model with an int32 map" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithInt32Map.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a model with an int64 map" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithInt64Map.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a model with an date-time map" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithDateTimeMap.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a model with xml properties" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithXmlAttributes.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-}
diff --git a/src/test/scala/ModelsTest.scala b/src/test/scala/ModelsTest.scala
deleted file mode 100644
index 9b505d6e47..0000000000
--- a/src/test/scala/ModelsTest.scala
+++ /dev/null
@@ -1,55 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class ModelsTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("definitions"))
-
- it should "validate a models hash" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/models.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate multiple models" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/multipleModels.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate models with examples" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithExamples.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate models with composition" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/modelWithComposition.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-}
diff --git a/src/test/scala/OperationsTest.scala b/src/test/scala/OperationsTest.scala
deleted file mode 100644
index 9ed604247b..0000000000
--- a/src/test/scala/OperationsTest.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class OperationsTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("operation"))
-
- it should "validate a resource with string path param" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/operations/stringPathParamResource.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a resource with string path param and boolean query param" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/operations/stringPathAndBoolQueryParamResource.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a resource with tags in the operation" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/operations/operationWithTags.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-}
diff --git a/src/test/scala/ParameterTest.scala b/src/test/scala/ParameterTest.scala
deleted file mode 100644
index 9b60c23f5c..0000000000
--- a/src/test/scala/ParameterTest.scala
+++ /dev/null
@@ -1,263 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("parameter"))
-
- it should "validate a string query parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/queryInt64Parameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an int64 array query parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/queryInt64ArrayParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string header parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/headerStringParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string array header parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/headerStringArrayParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a int64 array header parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/headerInt64ArrayParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string path parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/pathStringParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a int64 path parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/pathInt64Parameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string array path parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/pathStringArrayParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an int64 body parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyInt64Parameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string body parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyStringParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string array body parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyStringArrayParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a complex body parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyComplexParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a complex body array parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyComplexArrayParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a complex body with inline schema parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyComplexInlineParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an int64 form data parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/formDataInt64Parameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string array form data parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/formDataStringArrayParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- // Negative tests
-
- it should "fail to validate a complex form data parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/formDataComplexParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate form data parameter with schema" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/formDataSchemaParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate a complex query parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/queryComplexParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate query parameter with schema" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/querySchemaParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate a header data parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/headerComplexParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate header parameter with schema" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/headerSchemaParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate a complex path parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/pathComplexParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate path parameter with schema" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/pathSchemaParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate body parameter with type file" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/bodyFileParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate header parameter with type file" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/headerFileParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate path parameter with type file" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/pathFileParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate query parameter with type file" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/queryFileParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate body parameter non schema type" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/bodyNonSchemaParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail to validate non-required path parameter" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/negative/pathNonRequiredStringParameter.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-}
diff --git a/src/test/scala/PropertyTest.scala b/src/test/scala/PropertyTest.scala
deleted file mode 100644
index 3de63b119b..0000000000
--- a/src/test/scala/PropertyTest.scala
+++ /dev/null
@@ -1,136 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class PropertyTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("schema"))
-
- it should "validate a simple string property" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/simpleStringProperty.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a simple int32 property" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/simpleInt32Property.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a simple int64 property" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/simpleInt64Property.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a simple date-time property" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/simpleDateTimeProperty.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a simple boolean property" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/simpleBooleanProperty.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a simple byte property" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/simpleByteProperty.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an array property with string" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/propertyWithStringArray.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an array property with int32" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/propertyWithInt32Array.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an array property with int64" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/propertyWithInt64Array.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an array property with boolean" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/propertyWithBooleanArray.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an array property with byte" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/propertyWithByteArray.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an array property with date-time" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/propertyWithDateTimeArray.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an array property with complex type" in {
- val json = Source.fromFile("fixtures/v2.0/json/models/properties/propertyWithComplexArray.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-}
diff --git a/src/test/scala/ResourcesTest.scala b/src/test/scala/ResourcesTest.scala
deleted file mode 100644
index a2dededbae..0000000000
--- a/src/test/scala/ResourcesTest.scala
+++ /dev/null
@@ -1,154 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class ResourcesTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema)
-
- it should "validate a resource with string path param" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/stringPathParamResource.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with common params" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/commonParameters.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with vendor extensions" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/vendorExtensionExamples.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a resource with example payload" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/resourceWithExamplePayload.json").getLines.filter(!_.startsWith("//")).mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a resource with cascading schemes" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/cascadingSchemes.json").getLines.filter(!_.startsWith("//")).mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with relative host" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/resourceWithRelativeHost.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with linked resources" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/resourceWithLinkedDefinitions.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with multiple mime types" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/multipleMimeTypes.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with security info" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/securityExample.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with tag info" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/taggedResource.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a spec with reusable parameters" in {
- val json = Source.fromFile("fixtures/v2.0/json/resources/reusableParameters.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate the swagger petstore" in {
- val json = Source.fromFile("examples/v2.0/json/petstore.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate the swagger petstore with external docs" in {
- val json = Source.fromFile("examples/v2.0/json/petstore-with-external-docs.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate mads sample 1" in {
- val json = Source.fromFile("examples/v2.0/json/petstore-simple.json").getLines.filter(!_.startsWith("//")).mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate mads sample 2" in {
- val json = Source.fromFile("examples/v2.0/json/petstore-expanded.json").getLines.filter(!_.startsWith("//")).mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-}
diff --git a/src/test/scala/ResponseTest.scala b/src/test/scala/ResponseTest.scala
deleted file mode 100644
index 8f73858bb3..0000000000
--- a/src/test/scala/ResponseTest.scala
+++ /dev/null
@@ -1,91 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class ResponseTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("response"))
-
- it should "validate a string response" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/stringResponse.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an int32 response" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/int32Response.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an int64 response" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/int64Response.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate an date-time response" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/dateTimeResponse.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a void response" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/voidResponse.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string array response" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/stringArrayResponse.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a complex array response" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/complexArrayResponse.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- it should "validate a string response with header" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/stringResponseWithHeader.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-}
diff --git a/src/test/scala/ResponsesTest.scala b/src/test/scala/ResponsesTest.scala
deleted file mode 100644
index ae7ce65240..0000000000
--- a/src/test/scala/ResponsesTest.scala
+++ /dev/null
@@ -1,44 +0,0 @@
-import com.fasterxml.jackson.databind.JsonNode
-import com.github.fge.jsonschema.core.exceptions.ProcessingException
-import com.github.fge.jsonschema.main.{ JsonSchema, JsonSchemaFactory}
-import com.github.fge.jsonschema.core.report.ProcessingReport
-import com.github.fge.jackson.JsonLoader
-
-import scala.io.Source
-
-import org.junit.runner.RunWith
-import org.scalatest.junit.JUnitRunner
-import org.scalatest.FlatSpec
-import org.scalatest.matchers.ShouldMatchers
-
-@RunWith(classOf[JUnitRunner])
-class ResponsesTest extends FlatSpec with ShouldMatchers with TestBase {
- val schema = readSchema(true)
- val factory = JsonSchemaFactory.byDefault()
- val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("responses"))
-
- it should "validate multiple responses" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/multipleResponses.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- if(report.isSuccess == false)
- println(report)
- report.isSuccess should be (true)
- }
-
- // Negative tests
-
- it should "fail validation on no responses" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/negative/noResponses.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-
- it should "fail validation on no responses with vendor extension" in {
- val json = Source.fromFile("fixtures/v2.0/json/responses/negative/noResponsesWithVendorExtension.json").mkString
- val data = JsonLoader.fromString(json)
- val report = jsonSchema.validate(data)
- report.isSuccess should be (false)
- }
-}
diff --git a/src/test/scala/TestBase.scala b/src/test/scala/TestBase.scala
deleted file mode 100644
index 0c4c08bf1c..0000000000
--- a/src/test/scala/TestBase.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-import com.fasterxml.jackson.databind.ObjectMapper
-
-import scala.io.Source
-
-/**
- * makes the schemas absolute so the java json-schema validator can locate
- * references correctly
- **/
-trait TestBase {
- val mapper = new ObjectMapper
- val host = "http://swagger.io/v2/schema.json"
- // val host = "http://localhost:8000/schema.json"
-
- def readSchema(makeQualified: Boolean = true) = {
- val json = Source.fromFile("schemas/v2.0/schema.json").getLines
- val lines = {
- if(makeQualified) {
- for(line <- json) yield {
- line.replace("\"#/definitions", "\"" + host + "#/definitions")
- }
- }
- else json
- }.mkString
- mapper.readTree(lines)
- }
-}
diff --git a/swagger-logo.jpg b/swagger-logo.jpg
deleted file mode 100644
index 561caf24f3..0000000000
Binary files a/swagger-logo.jpg and /dev/null differ
diff --git a/test/validate.js b/test/validate.js
deleted file mode 100644
index 849f68a176..0000000000
--- a/test/validate.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var fs = require('fs');
-var path = require('path');
-
-var _ = require('lodash');
-var glob = require('glob');
-var yaml = require('js-yaml');
-var ZSchema = require('z-schema');
-var expect = require('chai').expect;
-var RefParser = require('json-schema-ref-parser');
-
-var schema = require('../schemas/v2.0/schema.json');
-
-function validate(data) {
- var validator = new ZSchema();
- validator.validate(data, schema);
- var error = validator.getLastError();
- error = JSON.stringify(error, null, 2);
- expect(error).to.deep.equal('null');
-}
-
-function readFile(file, isYaml) {
- var ext = path.extname(file);
- var data = fs.readFileSync(file, 'utf8');
-
- expect(ext).to.be.oneOf(['.json', '.yaml']);
- if (ext === '.yaml')
- return yaml.safeLoad(data);
- else if (ext === '.json')
- return JSON.parse(data);
-}
-
-function validateFiles(pattern) {
- files = glob.sync(pattern)
- files.forEach(function(file) {
- it("should validate " + file, function() {
- var swagger = readFile(file);
-
- expect(swagger).to.be.an('object');
- if (_.isUndefined(swagger.swagger))
- return;
-
- validate(swagger);
-
- return RefParser.dereference(file, {
- $refs: {
- internal: false // Don't dereference internal $refs, only external
- }
- })
- .then(function(resolveSwagger) {
- validate(resolveSwagger);
- });
- })
- })
-}
-
-describe('JSON Samples', function() {
- validateFiles('./examples/**/*.json')
-})
-
-describe('YAML Samples', function() {
- validateFiles('./examples/**/*.yaml')
-})
diff --git a/test/validate_spec.rb b/test/validate_spec.rb
deleted file mode 100644
index cf3666d071..0000000000
--- a/test/validate_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'json-schema'
-require 'json'
-require 'yaml'
-
-schema = JSON.parse(File.read('schemas/v2.0/schema.json'))
-Dir['examples/**/*.json'].each do |file|
- puts "Validating: #{file}"
- data = File.read file
- # require 'pry'; binding.pry
- puts JSON::Validator.fully_validate(schema, data, :validate_schema => true)
-end
-
-Dir['examples/**/*.yaml'].each do |file|
- puts "Validating: #{file}"
- data = YAML.load(File.read file)
- # require 'pry'; binding.pry
- puts JSON::Validator.fully_validate(schema, data, :validate_schema => true)
-end
diff --git a/versions/2.0.md b/versions/2.0.md
index 8b9b9525cb..5916e30c3e 100755
--- a/versions/2.0.md
+++ b/versions/2.0.md
@@ -318,7 +318,7 @@ Field Name | Type | Description
options | [Operation Object](#operationObject) | A definition of a OPTIONS operation on this path.
head | [Operation Object](#operationObject) | A definition of a HEAD operation on this path.
patch | [Operation Object](#operationObject) | A definition of a PATCH operation on this path.
-parameters | [[Parameter Object](#parameterObject) | [Reference Object](#referenceObject)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [Swagger Object's parameters](#swaggerParameters). There can be one "body" parameter at most.
+parameters | [[Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [Swagger Object's parameters](#swaggerParameters). There can be one "body" parameter at most.
##### Patterned Fields
@@ -417,7 +417,7 @@ Field Name | Type | Description
operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.
consumes | [`string`] | A list of MIME types the operation can consume. This overrides the [`consumes`](#swaggerConsumes) definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under [Mime Types](#mimeTypes).
produces | [`string`] | A list of MIME types the operation can produce. This overrides the [`produces`](#swaggerProduces) definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under [Mime Types](#mimeTypes).
-parameters | [[Parameter Object](#parameterObject) | [Reference Object](#referenceObject)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [Swagger Object's parameters](#swaggerParameters). There can be one "body" parameter at most.
+parameters | [[Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [Swagger Object's parameters](#swaggerParameters). There can be one "body" parameter at most.
responses | [Responses Object](#responsesObject) | **Required.** The list of possible responses as they are returned from executing this operation.
schemes | [`string`] | The transfer protocol for the operation. Values MUST be from the list: `"http"`, `"https"`, `"ws"`, `"wss"`. The value overrides the Swagger Object [`schemes`](#swaggerSchemes) definition.
deprecated | `boolean` | Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is `false`.
@@ -844,12 +844,12 @@ The `Responses Object` MUST contain at least one response code, and it SHOULD be
##### Fixed Fields
Field Name | Type | Description
---|:---:|---
-default | [Response Object](#responseObject) | [Reference Object](#referenceObject) | The documentation of responses other than the ones declared for specific HTTP response codes. It can be used to cover undeclared responses. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.
+default | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | The documentation of responses other than the ones declared for specific HTTP response codes. It can be used to cover undeclared responses. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.
##### Patterned Fields
Field Pattern | Type | Description
---|:---:|---
-{[HTTP Status Code](#httpCodes)} | [Response Object](#responseObject) | [Reference Object](#referenceObject) | Any [HTTP status code](#httpCodes) can be used as the property name (one property per HTTP status code). Describes the expected response for that HTTP status code. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.
+{[HTTP Status Code](#httpCodes)} | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | Any [HTTP status code](#httpCodes) can be used as the property name (one property per HTTP status code). Describes the expected response for that HTTP status code. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.
^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
diff --git a/versions/3.0.0.md b/versions/3.0.0.md
new file mode 100644
index 0000000000..30a041ad84
--- /dev/null
+++ b/versions/3.0.0.md
@@ -0,0 +1,3441 @@
+# OpenAPI Specification
+
+#### Version 3.0.0
+
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
+
+This document is licensed under [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
+
+## Introduction
+
+The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.
+
+An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
+
+## Table of Contents
+
+
+- [Definitions](#definitions)
+ - [OpenAPI Document](#oasDocument)
+ - [Path Templating](#pathTemplating)
+ - [Media Types](#mediaTypes)
+ - [HTTP Status Codes](#httpCodes)
+- [Specification](#specification)
+ - [Versions](#versions)
+ - [Format](#format)
+ - [Document Structure](#documentStructure)
+ - [Data Types](#dataTypes)
+ - [Rich Text Formatting](#richText)
+ - [Relative References In URLs](#relativeReferences)
+ - [Schema](#schema)
+ - [OpenAPI Object](#oasObject)
+ - [Info Object](#infoObject)
+ - [Contact Object](#contactObject)
+ - [License Object](#licenseObject)
+ - [Server Object](#serverObject)
+ - [Server Variable Object](#serverVariableObject)
+ - [Components Object](#componentsObject)
+ - [Paths Object](#pathsObject)
+ - [Path Item Object](#pathItemObject)
+ - [Operation Object](#operationObject)
+ - [External Documentation Object](#externalDocumentationObject)
+ - [Parameter Object](#parameterObject)
+ - [Request Body Object](#requestBodyObject)
+ - [Media Type Object](#mediaTypeObject)
+ - [Encoding Object](#encodingObject)
+ - [Responses Object](#responsesObject)
+ - [Response Object](#responseObject)
+ - [Callback Object](#callbackObject)
+ - [Example Object](#exampleObject)
+ - [Link Object](#linkObject)
+ - [Header Object](#headerObject)
+ - [Tag Object](#tagObject)
+ - [Reference Object](#referenceObject)
+ - [Schema Object](#schemaObject)
+ - [Discriminator Object](#discriminatorObject)
+ - [XML Object](#xmlObject)
+ - [Security Scheme Object](#securitySchemeObject)
+ - [OAuth Flows Object](#oauthFlowsObject)
+ - [OAuth Flow Object](#oauthFlowObject)
+ - [Security Requirement Object](#securityRequirementObject)
+ - [Specification Extensions](#specificationExtensions)
+ - [Security Filtering](#securityFiltering)
+- [Appendix A: Revision History](#revisionHistory)
+
+
+
+
+## Definitions
+
+##### OpenAPI Document
+A document (or set of documents) that defines or describes an API. An OpenAPI definition uses and conforms to the OpenAPI Specification.
+
+##### Path Templating
+Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.
+
+##### Media Types
+Media type definitions are spread across several resources.
+The media type definitions SHOULD be in compliance with [RFC6838](http://tools.ietf.org/html/rfc6838).
+
+Some examples of possible media type definitions:
+```
+ text/plain; charset=utf-8
+ application/json
+ application/vnd.github+json
+ application/vnd.github.v3+json
+ application/vnd.github.v3.raw+json
+ application/vnd.github.v3.text+json
+ application/vnd.github.v3.html+json
+ application/vnd.github.v3.full+json
+ application/vnd.github.v3.diff
+ application/vnd.github.v3.patch
+```
+##### HTTP Status Codes
+The HTTP Status Codes are used to indicate the status of the executed operation.
+The available status codes are defined by [RFC7231](http://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
+
+## Specification
+
+### Versions
+
+The OpenAPI Specification is versioned using [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html) (semver) and follows the semver specification.
+
+The `major`.`minor` portion of the semver (for example `3.0`) SHALL designate the OAS feature set. Typically, *`.patch`* versions address errors in this document, not the feature set. Tooling which supports OAS 3.0 SHOULD be compatible with all OAS 3.0.\* versions. The patch version SHOULD NOT be considered by tooling, making no distinction between `3.0.0` and `3.0.1` for example.
+
+Subsequent minor version releases of the OpenAPI Specification (incrementing the `minor` version number) SHOULD NOT interfere with tooling developed to a lower minor version and same major version. Thus a hypothetical `3.1.0` specification SHOULD be usable with tooling designed for `3.0.0`.
+
+An OpenAPI document compatible with OAS 3.\*.\* contains a required [`openapi`](#oasVersion) field which designates the semantic version of the OAS that it uses. (OAS 2.0 documents contain a top-level version field named [`swagger`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swaggerObject) and value `"2.0"`.)
+
+### Format
+
+An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
+
+For example, if a field has an array value, the JSON array representation will be used:
+
+```json
+{
+ "field": [ 1, 2, 3 ]
+}
+```
+All field names in the specification are **case sensitive**.
+
+The schema exposes two types of fields: Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name.
+
+Patterned fields MUST have unique names within the containing object.
+
+In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](http://www.yaml.org/spec/1.2/spec.html) is RECOMMENDED along with some additional constraints:
+
+- Tags MUST be limited to those allowed by the [JSON Schema ruleset](http://www.yaml.org/spec/1.2/spec.html#id2803231).
+- Keys used in YAML maps MUST be limited to a scalar string, as defined by the [YAML Failsafe schema ruleset](http://yaml.org/spec/1.2/spec.html#id2802346).
+
+**Note:** While APIs may be defined by OpenAPI documents in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
+
+### Document Structure
+
+An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the user. In the latter case, `$ref` fields MUST be used in the specification to reference those parts as follows from the [JSON Schema](http://json-schema.org) definitions.
+
+It is RECOMMENDED that the root OpenAPI document be named: `openapi.json` or `openapi.yaml`.
+
+### Data Types
+
+Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
+Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
+`null` is not supported as a type (see [`nullable`](#schemaNullable) for an alternative solution).
+Models are defined using the [Schema Object](#schemaObject), which is an extended subset of JSON Schema Specification Wright Draft 00.
+
+Primitives have an optional modifier property: `format`.
+OAS uses several known formats to define in fine detail the data type being used.
+However, to support documentation needs, the `format` property is an open `string`-valued property, and can have any value.
+Formats such as `"email"`, `"uuid"`, and so on, MAY be used even though undefined by this specification.
+Types that are not accompanied by a `format` property follow the type definition in the JSON Schema. Tools that do not recognize a specific `format` MAY default back to the `type` alone, as if the `format` is not specified.
+
+The formats defined by the OAS are:
+
+Common Name | [`type`](#dataTypes) | [`format`](#dataTypeFormat) | Comments
+----------- | ------ | -------- | --------
+integer | `integer` | `int32` | signed 32 bits
+long | `integer` | `int64` | signed 64 bits
+float | `number` | `float` | |
+double | `number` | `double` | |
+string | `string` | | |
+byte | `string` | `byte` | base64 encoded characters
+binary | `string` | `binary` | any sequence of octets
+boolean | `boolean` | | |
+date | `string` | `date` | As defined by `full-date` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
+dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
+password | `string` | `password` | A hint to UIs to obscure input.
+
+### Rich Text Formatting
+Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
+Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](http://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark features to address security concerns.
+
+### Relative References in URLs
+
+Unless specified otherwise, all properties that are URLs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+Relative references are resolved using the URLs defined in the [`Server Object`](#serverObject) as a Base URI.
+
+Relative references used in `$ref` are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), using the URL of the current document as the base URI. See also the [Reference Object](#referenceObject).
+
+### Schema
+
+In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
+
+#### OpenAPI Object
+
+This is the root document object of the [OpenAPI document](#oasDocument).
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+openapi | `string` | **REQUIRED**. This string MUST be the [semantic version number](http://semver.org/spec/v2.0.0.html) of the [OpenAPI Specification version](#versions) that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is *not* related to the API [`info.version`](#infoVersion) string.
+info | [Info Object](#infoObject) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required.
+servers | [[Server Object](#serverObject)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#serverObject) with a [url](#serverUrl) value of `/`.
+paths | [Paths Object](#pathsObject) | **REQUIRED**. The available paths and operations for the API.
+components | [Components Object](#componentsObject) | An element to hold various schemas for the specification.
+security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
+tags | [[Tag Object](#tagObject)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operationObject) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
+externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+#### Info Object
+
+The object provides metadata about the API.
+The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+title | `string` | **REQUIRED**. The title of the application.
+description | `string` | A short description of the application. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+termsOfService | `string` | A URL to the Terms of Service for the API. MUST be in the format of a URL.
+contact | [Contact Object](#contactObject) | The contact information for the exposed API.
+license | [License Object](#licenseObject) | The license information for the exposed API.
+version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oasVersion) or the API implementation version).
+
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### Info Object Example:
+
+```json
+{
+ "title": "Sample Pet Store App",
+ "description": "This is a sample server for a pet store.",
+ "termsOfService": "http://example.com/terms/",
+ "contact": {
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+ },
+ "license": {
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+ },
+ "version": "1.0.1"
+}
+```
+
+```yaml
+title: Sample Pet Store App
+description: This is a sample server for a pet store.
+termsOfService: http://example.com/terms/
+contact:
+ name: API Support
+ url: http://www.example.com/support
+ email: support@example.com
+license:
+ name: Apache 2.0
+ url: http://www.apache.org/licenses/LICENSE-2.0.html
+version: 1.0.1
+```
+
+#### Contact Object
+
+Contact information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | The identifying name of the contact person/organization.
+url | `string` | The URL pointing to the contact information. MUST be in the format of a URL.
+email | `string` | The email address of the contact person/organization. MUST be in the format of an email address.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### Contact Object Example:
+
+```json
+{
+ "name": "API Support",
+ "url": "http://www.example.com/support",
+ "email": "support@example.com"
+}
+```
+
+```yaml
+name: API Support
+url: http://www.example.com/support
+email: support@example.com
+```
+
+#### License Object
+
+License information for the exposed API.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The license name used for the API.
+url | `string` | A URL to the license used for the API. MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### License Object Example:
+
+```json
+{
+ "name": "Apache 2.0",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+}
+```
+
+```yaml
+name: Apache 2.0
+url: http://www.apache.org/licenses/LICENSE-2.0.html
+```
+
+#### Server Object
+
+An object representing a Server.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
+description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+variables | Map[`string`, [Server Variable Object](#serverVariableObject)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### Server Object Example
+
+A single server would be described as:
+
+```json
+{
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+}
+```
+
+```yaml
+url: https://development.gigantic-server.com/v1
+description: Development server
+```
+
+The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+ },
+ {
+ "url": "https://staging.gigantic-server.com/v1",
+ "description": "Staging server"
+ },
+ {
+ "url": "https://api.gigantic-server.com/v1",
+ "description": "Production server"
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://development.gigantic-server.com/v1
+ description: Development server
+- url: https://staging.gigantic-server.com/v1
+ description: Staging server
+- url: https://api.gigantic-server.com/v1
+ description: Production server
+```
+
+The following shows how variables can be used for a server configuration:
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
+ "description": "The production API server",
+ "variables": {
+ "username": {
+ "default": "demo",
+ "description": "this value is assigned by the service provider, in this example `gigantic-server.com`"
+ },
+ "port": {
+ "enum": [
+ "8443",
+ "443"
+ ],
+ "default": "8443"
+ },
+ "basePath": {
+ "default": "v2"
+ }
+ }
+ }
+ ]
+}
+```
+
+```yaml
+servers:
+- url: https://{username}.gigantic-server.com:{port}/{basePath}
+ description: The production API server
+ variables:
+ username:
+ # note! no enum here means it is an open value
+ default: demo
+ description: this value is assigned by the service provider, in this example `gigantic-server.com`
+ port:
+ enum:
+ - '8443'
+ - '443'
+ default: '8443'
+ basePath:
+ # open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
+ default: v2
+```
+
+
+#### Server Variable Object
+
+An object representing a Server Variable for server URL template substitution.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+enum | [`string`] | An enumeration of string values to be used if the substitution options are from a limited set.
+default | `string` | **REQUIRED**. The default value to use for substitution, and to send, if an alternate value is _not_ supplied. Unlike the [Schema Object's](#schemaObject) `default`, this value MUST be provided by the consumer.
+description | `string` | An optional description for the server variable. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+#### Components Object
+
+Holds a set of reusable objects for different aspects of the OAS.
+All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
+
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---|---
+ schemas | Map[`string`, [Schema Object](#schemaObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Schema Objects](#schemaObject).
+ responses | Map[`string`, [Response Object](#responseObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Response Objects](#responseObject).
+ parameters | Map[`string`, [Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Parameter Objects](#parameterObject).
+ examples | Map[`string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Example Objects](#exampleObject).
+ requestBodies | Map[`string`, [Request Body Object](#requestBodyObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Request Body Objects](#requestBodyObject).
+ headers | Map[`string`, [Header Object](#headerObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Header Objects](#headerObject).
+ securitySchemes| Map[`string`, [Security Scheme Object](#securitySchemeObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Security Scheme Objects](#securitySchemeObject).
+ links | Map[`string`, [Link Object](#linkObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Link Objects](#linkObject).
+ callbacks | Map[`string`, [Callback Object](#callbackObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Callback Objects](#callbackObject).
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`.
+
+Field Name Examples:
+
+```
+User
+User_1
+User_Name
+user-name
+my.org.User
+```
+
+##### Components Object Example
+
+```json
+"components": {
+ "schemas": {
+ "Category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "Tag": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "skipParam": {
+ "name": "skip",
+ "in": "query",
+ "description": "number of items to skip",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "limitParam": {
+ "name": "limit",
+ "in": "query",
+ "description": "max records to return",
+ "required": true,
+ "schema" : {
+ "type": "integer",
+ "format": "int32"
+ }
+ }
+ },
+ "responses": {
+ "NotFound": {
+ "description": "Entity not found."
+ },
+ "IllegalInput": {
+ "description": "Illegal input for operation."
+ },
+ "GeneralError": {
+ "description": "General Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/GeneralError"
+ }
+ }
+ }
+ }
+ },
+ "securitySchemes": {
+ "api_key": {
+ "type": "apiKey",
+ "name": "api_key",
+ "in": "header"
+ },
+ "petstore_auth": {
+ "type": "oauth2",
+ "flows": {
+ "implicit": {
+ "authorizationUrl": "http://example.org/api/oauth/dialog",
+ "scopes": {
+ "write:pets": "modify pets in your account",
+ "read:pets": "read your pets"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+components:
+ schemas:
+ Category:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ parameters:
+ skipParam:
+ name: skip
+ in: query
+ description: number of items to skip
+ required: true
+ schema:
+ type: integer
+ format: int32
+ limitParam:
+ name: limit
+ in: query
+ description: max records to return
+ required: true
+ schema:
+ type: integer
+ format: int32
+ responses:
+ NotFound:
+ description: Entity not found.
+ IllegalInput:
+ description: Illegal input for operation.
+ GeneralError:
+ description: General Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GeneralError'
+ securitySchemes:
+ api_key:
+ type: apiKey
+ name: api_key
+ in: header
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: http://example.org/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+
+#### Paths Object
+
+Holds the relative paths to the individual endpoints and their operations.
+The path is appended to the URL from the [`Server Object`](#serverObject) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#securityFiltering).
+
+##### Patterned Fields
+
+Field Pattern | Type | Description
+---|:---:|---
+/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#serverObject)'s `url` field in order to construct the full URL. [Path templating](#pathTemplating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### Path Templating Matching
+
+Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
+
+```
+ /pets/{petId}
+ /pets/mine
+```
+
+The following paths are considered identical and invalid:
+
+```
+ /pets/{petId}
+ /pets/{name}
+```
+
+The following may lead to ambiguous resolution:
+
+```
+ /{entity}/me
+ /books/{id}
+```
+
+##### Paths Object Example
+
+```json
+{
+ "/pets": {
+ "get": {
+ "description": "Returns all pets from the system that the user has access to",
+ "responses": {
+ "200": {
+ "description": "A list of pets.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/pet"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```yaml
+/pets:
+ get:
+ description: Returns all pets from the system that the user has access to
+ responses:
+ '200':
+ description: A list of pets.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/pet'
+```
+
+#### Path Item Object
+
+Describes the operations available on a single path.
+A Path Item MAY be empty, due to [ACL constraints](#securityFiltering).
+The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#pathItemObject). If there are conflicts between the referenced definition and this Path Item's definition, the behavior is *undefined*.
+summary| `string` | An optional, string summary, intended to apply to all operations in this path.
+description | `string` | An optional, string description, intended to apply to all operations in this path. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+get | [Operation Object](#operationObject) | A definition of a GET operation on this path.
+put | [Operation Object](#operationObject) | A definition of a PUT operation on this path.
+post | [Operation Object](#operationObject) | A definition of a POST operation on this path.
+delete | [Operation Object](#operationObject) | A definition of a DELETE operation on this path.
+options | [Operation Object](#operationObject) | A definition of a OPTIONS operation on this path.
+head | [Operation Object](#operationObject) | A definition of a HEAD operation on this path.
+patch | [Operation Object](#operationObject) | A definition of a PATCH operation on this path.
+trace | [Operation Object](#operationObject) | A definition of a TRACE operation on this path.
+servers | [[Server Object](#serverObject)] | An alternative `server` array to service all operations in this path.
+parameters | [[Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### Path Item Object Example
+
+```json
+{
+ "get": {
+ "description": "Returns pets based on ID",
+ "summary": "Find pets by ID",
+ "operationId": "getPetsById",
+ "responses": {
+ "200": {
+ "description": "pet response",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Pet"
+ }
+ }
+ }
+ }
+ },
+ "default": {
+ "description": "error payload",
+ "content": {
+ "text/html": {
+ "schema": {
+ "$ref": "#/components/schemas/ErrorModel"
+ }
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "ID of pet to use",
+ "required": true,
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "style": "simple"
+ }
+ ]
+}
+```
+
+```yaml
+get:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: getPetsById
+ responses:
+ '200':
+ description: pet response
+ content:
+ '*/*' :
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Pet'
+ default:
+ description: error payload
+ content:
+ 'text/html':
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+parameters:
+- name: id
+ in: path
+ description: ID of pet to use
+ required: true
+ schema:
+ type: array
+ style: simple
+ items:
+ type: string
+```
+
+#### Operation Object
+
+Describes a single API operation on a path.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
+summary | `string` | A short summary of what the operation does.
+description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this operation.
+operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
+parameters | [[Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [OpenAPI Object's components/parameters](#componentsParameters).
+requestBody | [Request Body Object](#requestBodyObject) \| [Reference Object](#referenceObject) | The request body applicable for this operation. The `requestBody` is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, `requestBody` SHALL be ignored by consumers.
+responses | [Responses Object](#responsesObject) | **REQUIRED**. The list of possible responses as they are returned from executing this operation.
+callbacks | Map[`string`, [Callback Object](#callbackObject) \| [Reference Object](#referenceObject)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callbackObject) that describes a request that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
+deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
+security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
+servers | [[Server Object](#serverObject)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### Operation Object Example
+
+```json
+{
+ "tags": [
+ "pet"
+ ],
+ "summary": "Updates a pet in the store with form data",
+ "operationId": "updatePetWithForm",
+ "parameters": [
+ {
+ "name": "petId",
+ "in": "path",
+ "description": "ID of pet that needs to be updated",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/x-www-form-urlencoded": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "Updated name of the pet",
+ "type": "string"
+ },
+ "status": {
+ "description": "Updated status of the pet",
+ "type": "string"
+ }
+ },
+ "required": ["status"]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Pet updated.",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ },
+ "405": {
+ "description": "Invalid input",
+ "content": {
+ "application/json": {},
+ "application/xml": {}
+ }
+ }
+ },
+ "security": [
+ {
+ "petstore_auth": [
+ "write:pets",
+ "read:pets"
+ ]
+ }
+ ]
+}
+```
+
+```yaml
+tags:
+- pet
+summary: Updates a pet in the store with form data
+operationId: updatePetWithForm
+parameters:
+- name: petId
+ in: path
+ description: ID of pet that needs to be updated
+ required: true
+ schema:
+ type: string
+requestBody:
+ content:
+ 'application/x-www-form-urlencoded':
+ schema:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ required:
+ - status
+responses:
+ '200':
+ description: Pet updated.
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+ '405':
+ description: Invalid input
+ content:
+ 'application/json': {}
+ 'application/xml': {}
+security:
+- petstore_auth:
+ - write:pets
+ - read:pets
+```
+
+
+#### External Documentation Object
+
+Allows referencing an external resource for extended documentation.
+
+##### Fixed Fields
+
+Field Name | Type | Description
+---|:---:|---
+description | `string` | A short description of the target documentation. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
+url | `string` | **REQUIRED**. The URL for the target documentation. Value MUST be in the format of a URL.
+
+This object MAY be extended with [Specification Extensions](#specificationExtensions).
+
+##### External Documentation Object Example
+
+```json
+{
+ "description": "Find more info here",
+ "url": "https://example.com"
+}
+```
+
+```yaml
+description: Find more info here
+url: https://example.com
+```
+
+#### Parameter Object
+
+Describes a single operation parameter.
+
+A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
+
+##### Parameter Locations
+There are four possible parameter locations specified by the `in` field:
+* path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
+* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
+* header - Custom headers that are expected as part of the request. Note that [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive.
+* cookie - Used to pass a specific cookie value to the API.
+
+
+##### Fixed Fields
+Field Name | Type | Description
+---|:---:|---
+name | `string` | **REQUIRED**. The name of the parameter. Parameter names are *case sensitive*.