Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Spec 2.0's Schema #150

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
23e03fb
Changed swagger version from number to string
webron Sep 22, 2014
feced8d
Update README.md
webron Sep 22, 2014
70ad282
Fixed swagger version in samples
Sep 22, 2014
2823bbc
Disabled online petstore test while modifying the schema
webron Sep 22, 2014
291dbd9
Fixed yaml sample swagger version
Sep 22, 2014
60c666c
Apparently, I can't even comment properly.
webron Sep 22, 2014
27310fb
Pushing partial schema updates
Sep 23, 2014
56a7739
Update TestBase.scala
webron Sep 23, 2014
0cc4829
fixed parameter definitions reference
Sep 23, 2014
052f43b
fixed additional properties for parameter
Sep 23, 2014
4784652
another attempt to fix parameters
Sep 23, 2014
6c84a76
and another attempt
Sep 23, 2014
171e4e9
and another
Sep 23, 2014
4061a2b
hopefully a final fix
Sep 23, 2014
29769fd
changes to the parameter object
Sep 30, 2014
e3ad005
removed body param name constraint
Sep 30, 2014
ec2d072
even more changes
Oct 1, 2014
dc991ac
added missing validation definitions
Oct 1, 2014
7facf9f
fixed headers, added enum def
Oct 1, 2014
3317ffd
fixed headers
Oct 1, 2014
dc856bf
fixed samples/fixtures to support proper headers format
Oct 1, 2014
5db5bf0
fixed yaml sample?
Oct 1, 2014
f861d67
trying a weird fix
Oct 1, 2014
f99da22
another fix attempt
Oct 1, 2014
0f3f00f
proper fix
Oct 1, 2014
3d44bb7
finished overview of existing definitions
Oct 7, 2014
068d54a
fixed fixture for testing
Oct 7, 2014
f9093cf
added securityDefinitions
Oct 8, 2014
74fcbc5
added security definitions
Oct 8, 2014
d39a933
fixed securityRequirement reference
Oct 8, 2014
b9c7f35
fixed securityExample.json
Oct 8, 2014
6a31490
moved contact and license to their own objects
Oct 9, 2014
dbec4c1
added a few more default values
Oct 9, 2014
8a4a41b
Fixed the limit of responses to at least one response.
Oct 9, 2014
c3c445f
added restrictions to the host regex
Oct 10, 2014
ea8cbfa
fixed host regex escaping
Oct 10, 2014
5fffdfd
Fixed host/basepath in petstore-simple
Oct 10, 2014
17e37fb
fixed path regex for paths object
Oct 10, 2014
b2300f9
tightened responses name for responses
Oct 10, 2014
5dd7922
fine tuned collectionFormat's multi restrictions
Oct 10, 2014
3873cab
Fine-tuned parameter's file usage
Oct 13, 2014
b5cefa2
fixed parameter type splitting
Oct 13, 2014
dd2c06d
fixed xml's type
Oct 13, 2014
5cd36be
added additional uniqueItem constraints
Oct 13, 2014
a70047b
added vendor extensions to security defs
Oct 13, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The Swagger Specification

[![Build Status](https://travis-ci.org/reverb/swagger-spec.svg?branch=master)](https://travis-ci.org/wordnik/swagger-spec)
[![Build Status](https://travis-ci.org/webron/swagger-spec.svg?branch=master)](https://travis-ci.org/webron/swagger-spec)

![](https://raw.github.com/wordnik/swagger-spec/master/swagger-logo.jpg)
## Welcome to the Swagger Project!
Expand Down
2 changes: 1 addition & 1 deletion examples/v2.0/json/petstore-expanded.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
Expand Down
5 changes: 3 additions & 2 deletions examples/v2.0/json/petstore-simple.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
Expand All @@ -12,7 +12,8 @@
"name": "MIT"
}
},
"host": "petstore.swagger.wordnik.com/api",
"host": "petstore.swagger.wordnik.com",
"basePath": "/api",
"schemes": [
"http"
],
Expand Down
2 changes: 1 addition & 1 deletion examples/v2.0/json/petstore-with-external-docs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
Expand Down
6 changes: 3 additions & 3 deletions examples/v2.0/json/petstore.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
Expand Down Expand Up @@ -31,11 +31,11 @@
"$ref": "#/definitions/Pet"
}
},
"headers": [{
"headers": {
"x-expires": {
"type": "string"
}
}]
}
},
"default": {
"description": "unexpected error",
Expand Down
2 changes: 1 addition & 1 deletion examples/v2.0/yaml/petstore-expanded.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
swagger: 2.0
swagger: "2.0"
info:
version: 1.0.0
title: Swagger Petstore
Expand Down
4 changes: 2 additions & 2 deletions examples/v2.0/yaml/petstore.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
swagger: 2.0
swagger: "2.0"
info:
version: 1.0.0
title: Swagger Petstore
Expand Down Expand Up @@ -30,7 +30,7 @@ paths:
200:
description: An paged array of pets
headers:
- x-next:
x-next:
type: string
description: A link to the next page of responses
schema:
Expand Down
2 changes: 1 addition & 1 deletion examples/v2.0/yaml/uber.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: 2
swagger: "2.0"
info:
title: Uber API
description: Move your app forward with the Uber API
Expand Down
2 changes: 1 addition & 1 deletion fixtures/v2.0/json/resources/cascadingSchemes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/v2.0/json/resources/commonParameters.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/v2.0/json/resources/multipleMimeTypes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/v2.0/json/resources/resourceWithRelativeHost.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/v2.0/json/resources/reusableParameters.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
116 changes: 69 additions & 47 deletions fixtures/v2.0/json/resources/securityExample.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down Expand Up @@ -28,13 +28,10 @@
],
"security": [
{
"githubAuth": { "$ref": "#/security/github/accessCode" }
"githubAccessCode": [ "user", "gist" ]
},
{
"internalApiKey": {
"type": "header",
"name": "api_key"
}
"internalApiKey": []
}
],
"paths": {
Expand All @@ -58,12 +55,13 @@
"operationId": "getPetsById",
"security": [
{
"githubAuth": {
"scopes": [ "user:read", "user:write" ]
}
"githubAuth":[
"user:read",
"user:write"
]
},
{
"internalApiKey":{}
"internalApiKey": []
}
],
"produces": [
Expand All @@ -90,43 +88,64 @@
}
}
},
"security": {
"github": {
"securityDefinitions": {
"githubAccessCode": {
"type": "oauth2",
"scopes": [
{ "user": "Grants read/write access to profile info only. Note that this scope includes user:email and user:follow." },
{ "user:email": "Grants read access to a user’s email addresses." },
{ "user:follow": "Grants access to follow or unfollow other users." },
{ "public_repo": "Grants read/write access to code, commit statuses, and deployment statuses for public repositories and organizations." },
{ "repo": "Grants read/write access to code, commit statuses, and deployment statuses for public and private repositories and organizations." },
{ "repo_deployment": "Grants access to deployment statuses for public and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, without granting access to the code." },
{ "repo:status": "Grants read/write access to public and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses without granting access to the code." },
{ "delete_repo": "Grants access to delete adminable repositories." },
{ "notifications": "Grants read access to a user’s notifications. repo also provides this access." },
{ "gist": "Grants write access to gists." },
{ "read:repo_hook": "Grants read and ping access to hooks in public or private repositories." },
{ "write:repo_hook": "Grants read, write, and ping access to hooks in public or private repositories." },
{ "admin:repo_hook": "Grants read, write, ping, and delete access to hooks in public or private repositories." },
{ "read:org": "Read-only access to organization, teams, and membership." },
{ "write:org": "Publicize and unpublicize organization membership." },
{ "admin:org": "Fully manage organization, teams, and memberships." },
{ "read:public_key": "List and view details for public keys." },
{ "write:public_key": "Create, list, and view details for public keys." },
{ "admin:public_key": "Fully manage public keys." }
],
"accessCode": {
"authorize": {
"url": "https://github.com/login/oauth/authorize"
},
"token": {
"url": "https://github.com/login/oauth/access_token"
}
"scopes": {
"user": "Grants read/write access to profile info only. Note that this scope includes user:email and user:follow.",
"user:email": "Grants read access to a user’s email addresses.",
"user:follow": "Grants access to follow or unfollow other users.",
"public_repo": "Grants read/write access to code, commit statuses, and deployment statuses for public repositories and organizations.",
"repo": "Grants read/write access to code, commit statuses, and deployment statuses for public and private repositories and organizations.",
"repo_deployment": "Grants access to deployment statuses for public and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, without granting access to the code.",
"repo:status": "Grants read/write access to public and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses without granting access to the code.",
"delete_repo": "Grants access to delete adminable repositories.",
"notifications": "Grants read access to a user’s notifications. repo also provides this access.",
"gist": "Grants write access to gists.",
"read:repo_hook": "Grants read and ping access to hooks in public or private repositories.",
"write:repo_hook": "Grants read, write, and ping access to hooks in public or private repositories.",
"admin:repo_hook": "Grants read, write, ping, and delete access to hooks in public or private repositories.",
"read:org": "Read-only access to organization, teams, and membership.",
"write:org": "Publicize and unpublicize organization membership.",
"admin:org": "Fully manage organization, teams, and memberships.",
"read:public_key": "List and view details for public keys.",
"write:public_key": "Create, list, and view details for public keys.",
"admin:public_key": "Fully manage public keys."
},
"implicit": {
"login": {
"url": "http://petstore.swagger.wordnik.com/oauth/dialog"
}
}
"flow": "accessCode",
"authorizationUrl": "https://github.com/login/oauth/authorize",
"tokenUrl": "https://github.com/login/oauth/access_token"
},
"petstoreImplicit": {
"type": "oauth2",
"scopes": {
"user": "Grants read/write access to profile info only. Note that this scope includes user:email and user:follow.",
"user:email": "Grants read access to a user’s email addresses.",
"user:follow": "Grants access to follow or unfollow other users.",
"public_repo": "Grants read/write access to code, commit statuses, and deployment statuses for public repositories and organizations.",
"repo": "Grants read/write access to code, commit statuses, and deployment statuses for public and private repositories and organizations.",
"repo_deployment": "Grants access to deployment statuses for public and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, without granting access to the code.",
"repo:status": "Grants read/write access to public and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses without granting access to the code.",
"delete_repo": "Grants access to delete adminable repositories.",
"notifications": "Grants read access to a user’s notifications. repo also provides this access.",
"gist": "Grants write access to gists.",
"read:repo_hook": "Grants read and ping access to hooks in public or private repositories.",
"write:repo_hook": "Grants read, write, and ping access to hooks in public or private repositories.",
"admin:repo_hook": "Grants read, write, ping, and delete access to hooks in public or private repositories.",
"read:org": "Read-only access to organization, teams, and membership.",
"write:org": "Publicize and unpublicize organization membership.",
"admin:org": "Fully manage organization, teams, and memberships.",
"read:public_key": "List and view details for public keys.",
"write:public_key": "Create, list, and view details for public keys.",
"admin:public_key": "Fully manage public keys."
},
"flow": "implicit",
"authorizationUrl": "http://petstore.swagger.wordnik.com/oauth/dialog"
},
"internalApiKey": {
"type": "apiKey",
"in": "header",
"name": "api_key"
}
},
"definitions": {
Expand All @@ -144,7 +163,10 @@
}
},
"ErrorModel": {
"required": [ "code", "message" ],
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
Expand All @@ -156,4 +178,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion fixtures/v2.0/json/resources/stringPathParamResource.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"info": {
"version": "1.0.9-abcd",
"title": "Swagger Sample API",
Expand Down
4 changes: 2 additions & 2 deletions fixtures/v2.0/json/resources/taggedResource.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"x-reverb": {
"addAnythingYouWant": true
},
Expand Down Expand Up @@ -33,7 +33,7 @@
],
"tags": [
{
"foo": "bar"
"name": "pets"
}
],
"paths": {
Expand Down
2 changes: 1 addition & 1 deletion fixtures/v2.0/json/resources/vendorExtensionExamples.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"swagger": 2.0,
"swagger": "2.0",
"x-reverb": {
"addAnythingYouWant": true
},
Expand Down
8 changes: 4 additions & 4 deletions fixtures/v2.0/json/responses/stringResponseWithHeader.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"schema": {
"type": "string"
},
"headers": [
{ "is-dog": {"type": "boolean"} },
{ "is-cat": {"type": "boolean"} }
]
"headers": {
"is-dog": {"type": "boolean"},
"is-cat": {"type": "boolean"}
}
}
Loading