diff --git a/WIP/cascadingSchemes.yaml b/WIP/cascadingSchemes.yaml new file mode 100644 index 0000000..d108027 --- /dev/null +++ b/WIP/cascadingSchemes.yaml @@ -0,0 +1,23 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + '/pets/{petId}': {get: {description: 'Returns a pet based on ID', summary: 'Find pet by ID', operationId: getPetsById, produces: [application/json, text/html], parameters: [{name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'pet response', schema: {$ref: Pet}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}, schemes: [https]}} +definitions: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/commonParameters.yaml b/WIP/commonParameters.yaml new file mode 100644 index 0000000..9851b74 --- /dev/null +++ b/WIP/commonParameters.yaml @@ -0,0 +1,23 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + '/pets/{id}': {parameters: [{name: id, in: path, description: 'ID of pet to use', required: true, type: array, items: {type: string}, collectionFormat: csv}], get: {description: 'Returns pets based on ID', summary: 'Find pets by ID', operationId: getPetsById, produces: [application/json, text/html], responses: {'200': {description: 'pet response', schema: {type: array, items: {$ref: Pet}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +definitions: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/multipleMimeTypes.yaml b/WIP/multipleMimeTypes.yaml new file mode 100644 index 0000000..23bdc2d --- /dev/null +++ b/WIP/multipleMimeTypes.yaml @@ -0,0 +1,32 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - '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 +produces: + - application/json + - application/xml +paths: + '/pets/{id}': {parameters: [{name: id, in: path, description: 'ID of pet to use', required: true, type: array, items: {type: string}, collectionFormat: csv}], get: {description: 'Returns pets based on ID', summary: 'Find pets by ID', operationId: getPetsById, produces: [application/json, text/html], responses: {'200': {description: 'pet response', schema: {type: array, items: {$ref: Pet}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +definitions: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/operations/operationWithTags.yaml b/WIP/operations/operationWithTags.yaml new file mode 100644 index 0000000..a3c85b2 --- /dev/null +++ b/WIP/operations/operationWithTags.yaml @@ -0,0 +1,14 @@ +description: 'Returns a pet based on ID' +summary: 'Find pet by ID' +operationId: getPetsById +tags: + - foo + - bar +produces: + - application/json + - text/html +parameters: + - {name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: integer, format: int64} +responses: + '200': {description: 'a pet to be returned', schema: {$ref: Pet}} + default: {description: 'Unexpected error', schema: {$ref: ErrorModel}} diff --git a/WIP/operations/stringPathAndBoolQueryParamResource.yaml b/WIP/operations/stringPathAndBoolQueryParamResource.yaml new file mode 100644 index 0000000..a00b8c4 --- /dev/null +++ b/WIP/operations/stringPathAndBoolQueryParamResource.yaml @@ -0,0 +1,12 @@ +description: 'Returns a pet based on ID' +summary: 'Find pet by ID' +operationId: getPetsById +produces: + - application/json + - text/html +parameters: + - {name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: integer, format: int64} + - {name: includeDetails, in: query, description: 'include details in response', required: true, type: boolean} +responses: + '200': {description: 'a pet to be returned', schema: {$ref: Pet}} + default: {description: 'Unexpected error', schema: {$ref: ErrorModel}} diff --git a/WIP/operations/stringPathParamResource.yaml b/WIP/operations/stringPathParamResource.yaml new file mode 100644 index 0000000..8c46cc7 --- /dev/null +++ b/WIP/operations/stringPathParamResource.yaml @@ -0,0 +1,12 @@ +description: 'Returns a pet based on ID' +summary: 'Find pet by ID' +operationId: getPetsById +produces: + - application/json + - text/html +parameters: + - {name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: integer, format: int64} +responses: + '200': {description: fun, schema: {$ref: Pet}} + '400': {description: 'Invalid ID supplied <= this is purely for documentation', schema: {$ref: ErrorModel}} + default: {description: 'Unexpected error', schema: {$ref: ErrorModel}} diff --git a/WIP/parameters/bodyComplexArrayParameter.yaml b/WIP/parameters/bodyComplexArrayParameter.yaml new file mode 100644 index 0000000..511f8dc --- /dev/null +++ b/WIP/parameters/bodyComplexArrayParameter.yaml @@ -0,0 +1,8 @@ +name: user +in: body +description: 'user to add to the system' +required: true +schema: + type: array + items: {type: string} + format: csv diff --git a/WIP/parameters/bodyComplexParameter.yaml b/WIP/parameters/bodyComplexParameter.yaml new file mode 100644 index 0000000..13f8fd1 --- /dev/null +++ b/WIP/parameters/bodyComplexParameter.yaml @@ -0,0 +1,6 @@ +name: user +in: body +description: 'user to add to the system' +required: true +schema: + $ref: User diff --git a/WIP/parameters/bodyInt64Parameter.yaml b/WIP/parameters/bodyInt64Parameter.yaml new file mode 100644 index 0000000..a270d94 --- /dev/null +++ b/WIP/parameters/bodyInt64Parameter.yaml @@ -0,0 +1,7 @@ +name: id +in: body +description: 'id to add' +required: true +schema: + type: integer + format: int64 diff --git a/WIP/parameters/bodyStringArrayParameter.yaml b/WIP/parameters/bodyStringArrayParameter.yaml new file mode 100644 index 0000000..7d88b10 --- /dev/null +++ b/WIP/parameters/bodyStringArrayParameter.yaml @@ -0,0 +1,7 @@ +name: user +in: body +description: 'user to add to the system' +required: true +schema: + type: array + items: {type: string} diff --git a/WIP/parameters/bodyStringParameter.yaml b/WIP/parameters/bodyStringParameter.yaml new file mode 100644 index 0000000..7fe9dbd --- /dev/null +++ b/WIP/parameters/bodyStringParameter.yaml @@ -0,0 +1,6 @@ +name: user +in: body +description: 'user to add to the system' +required: true +schema: + type: string diff --git a/WIP/parameters/formDataComplexParameter.yaml b/WIP/parameters/formDataComplexParameter.yaml new file mode 100644 index 0000000..b49dd9e --- /dev/null +++ b/WIP/parameters/formDataComplexParameter.yaml @@ -0,0 +1,5 @@ +name: firstName +in: formData +description: 'users first name' +required: true +$ref: Nothing diff --git a/WIP/parameters/formDataInt64Parameter.yaml b/WIP/parameters/formDataInt64Parameter.yaml new file mode 100644 index 0000000..0faaa7f --- /dev/null +++ b/WIP/parameters/formDataInt64Parameter.yaml @@ -0,0 +1,6 @@ +name: id +in: formData +description: 'username to fetch' +required: true +type: integer +format: int64 diff --git a/WIP/parameters/formDataStringArrayParameter.yaml b/WIP/parameters/formDataStringArrayParameter.yaml new file mode 100644 index 0000000..f653466 --- /dev/null +++ b/WIP/parameters/formDataStringArrayParameter.yaml @@ -0,0 +1,7 @@ +name: user +in: formData +description: 'user to add to the system' +required: true +type: array +items: + type: string diff --git a/WIP/parameters/formDataStringParameter.yaml b/WIP/parameters/formDataStringParameter.yaml new file mode 100644 index 0000000..43411cf --- /dev/null +++ b/WIP/parameters/formDataStringParameter.yaml @@ -0,0 +1,5 @@ +name: firstName +in: formData +description: 'users first name' +required: true +type: string diff --git a/WIP/parameters/headerInt64ArrayParameter.yaml b/WIP/parameters/headerInt64ArrayParameter.yaml new file mode 100644 index 0000000..87ec99c --- /dev/null +++ b/WIP/parameters/headerInt64ArrayParameter.yaml @@ -0,0 +1,9 @@ +name: token +in: header +description: 'token to be passed as a header' +required: true +type: array +items: + type: integer + format: int64 +collectionFormat: csv diff --git a/WIP/parameters/headerStringArrayParameter.yaml b/WIP/parameters/headerStringArrayParameter.yaml new file mode 100644 index 0000000..70e0a0a --- /dev/null +++ b/WIP/parameters/headerStringArrayParameter.yaml @@ -0,0 +1,8 @@ +name: token +in: header +description: 'token to be passed as a header' +required: true +type: array +items: + type: string +collectionFormat: csv diff --git a/WIP/parameters/headerStringParameter.yaml b/WIP/parameters/headerStringParameter.yaml new file mode 100644 index 0000000..ac99c2f --- /dev/null +++ b/WIP/parameters/headerStringParameter.yaml @@ -0,0 +1,5 @@ +name: token +in: header +description: 'token to be passed as a header' +required: true +type: string diff --git a/WIP/parameters/pathInt64Parameter.yaml b/WIP/parameters/pathInt64Parameter.yaml new file mode 100644 index 0000000..3bd860a --- /dev/null +++ b/WIP/parameters/pathInt64Parameter.yaml @@ -0,0 +1,6 @@ +name: id +in: path +description: 'username to fetch' +required: true +type: integer +format: int64 diff --git a/WIP/parameters/pathStringArrayParameter.yaml b/WIP/parameters/pathStringArrayParameter.yaml new file mode 100644 index 0000000..ebb24a7 --- /dev/null +++ b/WIP/parameters/pathStringArrayParameter.yaml @@ -0,0 +1,8 @@ +name: usernames +in: path +description: 'usernames to pass' +required: true +type: array +items: + type: string +collectionFormat: csv diff --git a/WIP/parameters/pathStringParameter.yaml b/WIP/parameters/pathStringParameter.yaml new file mode 100644 index 0000000..2cb4fb2 --- /dev/null +++ b/WIP/parameters/pathStringParameter.yaml @@ -0,0 +1,5 @@ +name: username +in: path +description: 'username to fetch' +required: true +type: string diff --git a/WIP/parameters/queryInt64ArrayParameter.yaml b/WIP/parameters/queryInt64ArrayParameter.yaml new file mode 100644 index 0000000..453e24f --- /dev/null +++ b/WIP/parameters/queryInt64ArrayParameter.yaml @@ -0,0 +1,9 @@ +name: id +in: query +description: 'ID of the object to fetch' +required: true +type: array +items: + type: integer + format: int64 +collectionFormat: csv diff --git a/WIP/parameters/queryStringParameter.yaml b/WIP/parameters/queryStringParameter.yaml new file mode 100644 index 0000000..e1df685 --- /dev/null +++ b/WIP/parameters/queryStringParameter.yaml @@ -0,0 +1,6 @@ +name: id +in: query +description: 'ID of the object to fetch' +required: true +type: integer +format: int64 diff --git a/WIP/parameters/queryWithComplexParameter.yaml b/WIP/parameters/queryWithComplexParameter.yaml new file mode 100644 index 0000000..80bc795 --- /dev/null +++ b/WIP/parameters/queryWithComplexParameter.yaml @@ -0,0 +1,6 @@ +name: id +in: query +description: 'a complex object which should not validate' +required: true +schema: + $ref: Pet diff --git a/WIP/resourceWithExamplePayload.yaml b/WIP/resourceWithExamplePayload.yaml new file mode 100644 index 0000000..9828d96 --- /dev/null +++ b/WIP/resourceWithExamplePayload.yaml @@ -0,0 +1,23 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + '/pets/{petId}': {get: {description: 'Returns a pet based on ID', summary: 'Find pet by ID', operationId: getPetsById, produces: [application/json, text/html], parameters: [{name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'pet response', schema: {$ref: Pet}, examples: {application/json: {id: 9, category: {name: domestic}, name: monster, tags: [{name: 'for sale'}], status: alive}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +definitions: + Pet: {required: [name], properties: {name: {type: string, example: cat}, tag: {type: string, example: 'for sale'}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/resourceWithLinkedDefinitions.yaml b/WIP/resourceWithLinkedDefinitions.yaml new file mode 100644 index 0000000..b9b00c4 --- /dev/null +++ b/WIP/resourceWithLinkedDefinitions.yaml @@ -0,0 +1,23 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + '/pets/{petId}': {$ref: 'https://raw.githubusercontent.com/reverb/swagger-spec/master/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions_part1.json'} +definitions: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/resourceWithLinkedDefinitions_part1.yaml b/WIP/resourceWithLinkedDefinitions_part1.yaml new file mode 100644 index 0000000..7d358fb --- /dev/null +++ b/WIP/resourceWithLinkedDefinitions_part1.yaml @@ -0,0 +1,7 @@ +get: + description: 'Returns a pet based on ID' + summary: 'Find pet by ID' + operationId: getPetsById + produces: [application/json, text/html] + parameters: [{name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}] + responses: {'200': {description: 'pet response', schema: {$ref: Pet}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}} diff --git a/WIP/resourceWithRelativeHost.yaml b/WIP/resourceWithRelativeHost.yaml new file mode 100644 index 0000000..744aa72 --- /dev/null +++ b/WIP/resourceWithRelativeHost.yaml @@ -0,0 +1,22 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + '/pets/{id}': {parameters: [{name: id, in: path, description: 'ID of pet to use', required: true, type: array, items: {type: string}, collectionFormat: csv}], get: {description: 'Returns pets based on ID', summary: 'Find pets by ID', operationId: getPetsById, produces: [application/json, text/html], responses: {'200': {description: 'pet response', schema: {type: array, items: {$ref: Pet}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +definitions: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/reusableParameters.yaml b/WIP/reusableParameters.yaml new file mode 100644 index 0000000..1d258d0 --- /dev/null +++ b/WIP/reusableParameters.yaml @@ -0,0 +1,26 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + '/pets/{id}': {get: {description: 'Returns pets based on ID', summary: 'Find pets by ID', operationId: getPetsById, parameters: [{$ref: '#/parameters/skipParam'}, {$ref: '#/parameters/limitParam'}], responses: {'200': {description: 'pet response', schema: {type: array, items: {$ref: Pet}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +parameters: + skipParam: {name: skip, in: query, description: 'number of items to skip', required: true, type: integer, format: int32} + limitParam: {name: limit, in: query, description: 'max records to return', required: true, type: integer, format: int32} +definitions: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/securityExample.yaml b/WIP/securityExample.yaml new file mode 100644 index 0000000..007d26d --- /dev/null +++ b/WIP/securityExample.yaml @@ -0,0 +1,29 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +security: + - {githubAccessCode: [user, gist]} + - {internalApiKey: []} +paths: + '/pets/{id}': {parameters: [{name: id, in: path, description: 'ID of pet to use', required: true, type: array, items: {type: string}, collectionFormat: csv}], get: {description: 'Returns pets based on ID', summary: 'Find pets by ID', operationId: getPetsById, security: [{githubAuth: ['user:read', 'user:write']}, {internalApiKey: []}], produces: [application/json, text/html], responses: {'200': {description: 'pet response', schema: {type: array, items: {$ref: Pet}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +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.'}, 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: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/stringPathParamResource.yaml b/WIP/stringPathParamResource.yaml new file mode 100644 index 0000000..a4a83fe --- /dev/null +++ b/WIP/stringPathParamResource.yaml @@ -0,0 +1,23 @@ +swagger: '2.0' +info: + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + '/pets/{petId}': {get: {description: 'Returns a pet based on ID', summary: 'Find pet by ID', operationId: getPetsById, produces: [application/json, text/html], parameters: [{name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'pet response', schema: {$ref: Pet}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +definitions: + Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/taggedResource.yaml b/WIP/taggedResource.yaml new file mode 100644 index 0000000..1b8620e --- /dev/null +++ b/WIP/taggedResource.yaml @@ -0,0 +1,29 @@ +swagger: '2.0' +x-reverb: + addAnythingYouWant: true +info: + x-reverb-info: 'this is an example' + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +tags: + - {name: pets} +paths: + x-reverb-path-info: 'vendor info' + /pets: {x-vendor-method: {}, get: {x-vendor-operation-property: {}, description: 'Returns a pet based on ID', summary: 'Find pet by ID', operationId: getPetsById, produces: [application/json, text/html], parameters: [{x-vendor-parameter-property: {}, name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'pet response', schema: {$ref: Pet}}, x-vendor-operation-response-property: {}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +definitions: + Pet: {x-vendor-model-property: {}, required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} diff --git a/WIP/vendorExtensionExamples.yaml b/WIP/vendorExtensionExamples.yaml new file mode 100644 index 0000000..59bba0f --- /dev/null +++ b/WIP/vendorExtensionExamples.yaml @@ -0,0 +1,27 @@ +swagger: '2.0' +x-reverb: + addAnythingYouWant: true +info: + x-reverb-info: 'this is an example' + version: 1.0.9-abcd + title: 'Swagger Sample API' + description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' + termsOfService: 'http://helloreverb.com/terms/' + contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} + license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} +host: my.api.com +basePath: /v1 +schemes: + - http + - https +consumes: + - application/json +produces: + - application/json + - application/xml +paths: + x-reverb-path-info: 'vendor info' + /pets: {x-vendor-method: {}, get: {x-vendor-operation-property: {}, description: 'Returns a pet based on ID', summary: 'Find pet by ID', operationId: getPetsById, produces: [application/json, text/html], parameters: [{x-vendor-parameter-property: {}, name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'pet response', schema: {$ref: Pet}}, x-vendor-operation-response-property: {}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} +definitions: + Pet: {x-vendor-model-property: {}, required: [name], properties: {name: {type: string}, tag: {type: string}}} + ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}}