Skip to content

Commit

Permalink
feat: system specs (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam bacha authored Jul 22, 2020
1 parent b447d70 commit 0f164c1
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 95 deletions.
20 changes: 10 additions & 10 deletions spec_system/cascadingSchemes.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
swagger: '2.0'
protocol: "0.1.5"
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
version:
title:
description:
termsOfService:
contact:
license:
host: ${host_url}
basePath: /protocol
schemes:
- http
- https
Expand All @@ -17,7 +17,7 @@ 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]}}
'/protocol/{protocolId}': {get: {description: 'Returns a protocol based on ID', summary: 'Find protocol by ID', operationId: getPetsById, produces: [application/json, text/html], parameters: [{name: protocolId, in: path, description: 'ID of protocol that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'protocol 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}}}
22 changes: 11 additions & 11 deletions spec_system/commonParameters.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
swagger: '2.0'
protocol: "0.1.5"
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
version:
title:
description:
termsOfService:
contact:
license:
host: ${host_url}
basePath: /protocol
schemes:
- http
- https
Expand All @@ -17,7 +17,7 @@ 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}}}}}
'/protocol/{id}': {parameters: [{name: id, in: path, description: 'ID of protocol to use', required: true, type: array, items: {type: string}, collectionFormat: csv}], get: {description: 'Returns protocol based on ID', summary: 'Find protocol by ID', operationId: getProtocolById, produces: [application/json, text/html], responses: {'200': {description: 'protocol response', schema: {type: array, items: {$ref: protocol}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}}
definitions:
Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}}
Protocol: {required: [name], properties: {name: {type: string}, tag: {type: string}}}
ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}}
22 changes: 11 additions & 11 deletions spec_system/multipleMimeTypes.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
swagger: '2.0'
protocol: "0.1.5"
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
version:
title:
description:
termsOfService:
contact:
license:
host: ${host_url}
basePath: /protocol
schemes:
- http
- https
Expand All @@ -26,7 +26,7 @@ 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}}}}}
'/protocol/{id}': {parameters: [{name: id, in: path, description: 'ID of protocol to use', required: true, type: array, items: {type: string}, collectionFormat: csv}], get: {description: 'Returns protocol based on ID', summary: 'Find protocol by ID', operationId: getProtocolById, produces: [application/json, text/html], responses: {'200': {description: 'protocol response', schema: {type: array, items: {$ref: Protocol}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}}
definitions:
Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}}
Protocol: {required: [name], properties: {name: {type: string}, tag: {type: string}}}
ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}}
10 changes: 5 additions & 5 deletions spec_system/operations/operationWithTags.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
description: 'Returns a pet based on ID'
summary: 'Find pet by ID'
operationId: getPetsById
description: 'Returns a protocol based on ID'
summary: 'Find protocol by ID'
operationId: getprotocolsById
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}
- {name: protocolId, in: path, description: 'ID of protocol that needs to be fetched', required: true, type: integer, format: int64}
responses:
'200': {description: 'a pet to be returned', schema: {$ref: Pet}}
'200': {description: 'a protocol to be returned', schema: {$ref: protocol}}
default: {description: 'Unexpected error', schema: {$ref: ErrorModel}}
10 changes: 5 additions & 5 deletions spec_system/operations/stringPathAndBoolQueryParamResource.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
description: 'Returns a pet based on ID'
summary: 'Find pet by ID'
operationId: getPetsById
description: 'Returns a protocol based on ID'
summary: 'Find protocol by ID'
operationId: getprotocolsById
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: protocolId, in: path, description: 'ID of protocol 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}}
'200': {description: 'a protocol to be returned', schema: {$ref: protocol}}
default: {description: 'Unexpected error', schema: {$ref: ErrorModel}}
10 changes: 5 additions & 5 deletions spec_system/operations/stringPathParamResource.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
description: 'Returns a pet based on ID'
summary: 'Find pet by ID'
operationId: getPetsById
description: 'Returns a protocol based on ID'
summary: 'Find protocol by ID'
operationId: getprotocolsById
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: protocolId, in: path, description: 'ID of protocol that needs to be fetched', required: true, type: integer, format: int64}
responses:
'200': {description: fun, schema: {$ref: Pet}}
'200': {description: fun, schema: {$ref: protocol}}
'400': {description: 'Invalid ID supplied <= this is purely for documentation', schema: {$ref: ErrorModel}}
default: {description: 'Unexpected error', schema: {$ref: ErrorModel}}
22 changes: 11 additions & 11 deletions spec_system/resourceWithExamplePayload.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
swagger: '2.0'
protocol: "0.1.5"
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
version:
title:
description:
termsOfService:
contact:
license:
host: ${host_url}
basePath: /protocol
schemes:
- http
- https
Expand All @@ -17,7 +17,7 @@ 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}}}}}
'/protocol/{protocolId}': {get: {description: 'Returns a protocol based on ID', summary: 'Find protocol by ID', operationId: getProtocolById, produces: [application/json, text/html], parameters: [{name: protocolId, in: path, description: 'ID of protocol that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'protocol response', schema: {$ref: protocol},}}}}
definitions:
Pet: {required: [name], properties: {name: {type: string, example: cat}, tag: {type: string, example: 'for sale'}}}
protocol: {}
ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}}
23 changes: 12 additions & 11 deletions spec_system/securityExample.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
swagger: '2.0'
protocol: "0.1.5"
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
version:
title:
description:
termsOfService:
contact:
license:
host: ${host_url}
basePath: /protocol
schemes:
- http
- https
Expand All @@ -19,11 +20,11 @@ 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}}}}}
'/protocol/{id}': {parameters: [{name: id, in: path, description: 'ID of protocol to use', required: true, type: array, items: {type: string}, collectionFormat: csv}], get: {description: 'Returns protocols based on ID', summary: 'Find protocols by ID', operationId: getprotocolsById, security: [{githubAuth: ['user:read', 'user:write']}, {internalApiKey: []}], produces: [application/json, text/html], responses: {'200': {description: 'protocol response', schema: {type: array, items: {$ref: protocol}}}, 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'}
protocolstoreImplicit: {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://protocolstore.swagger.wordnik.com/oauth/dialog'}
internalApiKey: {type: apiKey, in: header, name: api_key}
definitions:
Pet: {required: [name], properties: {name: {type: string}, tag: {type: string}}}
protocol: {required: [name], properties: {name: {type: string}, tag: {type: string}}}
ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}}
Loading

0 comments on commit 0f164c1

Please sign in to comment.