Last active
January 30, 2019 11:49
-
-
Save podhmo/9a0fd361f251cab8a06ae5d0d7342f41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"op": "remove", | |
"path": "/schemes" | |
}, | |
{ | |
"op": "remove", | |
"path": "/swagger" | |
}, | |
{ | |
"op": "remove", | |
"path": "/basePath" | |
}, | |
{ | |
"op": "remove", | |
"path": "/host" | |
}, | |
{ | |
"op": "add", | |
"path": "/servers", | |
"value": [ | |
{ | |
"url": "http://api.example.com/v1", | |
"description": "Optional server description, e.g. Main (production) server" | |
}, | |
{ | |
"url": "http://staging-api.example.com", | |
"description": "Optional server description, e.g. Internal staging server for testing" | |
} | |
] | |
}, | |
{ | |
"op": "add", | |
"path": "/openapi", | |
"value": "3.0.0" | |
}, | |
{ | |
"op": "replace", | |
"path": "/info/description", | |
"value": "Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML." | |
}, | |
{ | |
"op": "replace", | |
"path": "/info/version", | |
"value": "0.1.9" | |
}, | |
{ | |
"op": "remove", | |
"path": "/paths/~1users/get/produces" | |
}, | |
{ | |
"op": "replace", | |
"path": "/paths/~1users/get/description", | |
"value": "Optional extended description in CommonMark or HTML." | |
}, | |
{ | |
"op": "replace", | |
"path": "/paths/~1users/get/responses/200", | |
"value": { | |
"description": "A JSON array of user names", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: "2.0" | |
info: | |
title: Sample API | |
description: API description in Markdown. | |
version: 1.0.0 | |
host: api.example.com | |
basePath: /v1 | |
schemes: | |
- https | |
paths: | |
/users: | |
get: | |
summary: Returns a list of users. | |
description: Optional extended description in Markdown. | |
produces: | |
- application/json | |
responses: | |
200: | |
description: OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.0 | |
info: | |
title: Sample API | |
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML. | |
version: 0.1.9 | |
servers: | |
- url: http://api.example.com/v1 | |
description: Optional server description, e.g. Main (production) server | |
- url: http://staging-api.example.com | |
description: Optional server description, e.g. Internal staging server for testing | |
paths: | |
/users: | |
get: | |
summary: Returns a list of users. | |
description: Optional extended description in CommonMark or HTML. | |
responses: | |
'200': # status code | |
description: A JSON array of user names | |
content: | |
application/json: | |
schema: | |
type: array | |
items: | |
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- data/2.0.yaml | |
+++ data/3.0.yaml | |
@@ -1,29 +1,41 @@ | |
{ | |
- "basePath": "/v1", | |
- "host": "api.example.com", | |
"info": { | |
- "description": "API description in Markdown.", | |
+ "description": "Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.", | |
"title": "Sample API", | |
- "version": "1.0.0" | |
+ "version": "0.1.9" | |
}, | |
+ "openapi": "3.0.0", | |
"paths": { | |
"/users": { | |
"get": { | |
- "description": "Optional extended description in Markdown.", | |
- "produces": [ | |
- "application/json" | |
- ], | |
+ "description": "Optional extended description in CommonMark or HTML.", | |
"responses": { | |
"200": { | |
- "description": "OK" | |
+ "content": { | |
+ "application/json": { | |
+ "schema": { | |
+ "items": { | |
+ "type": "string" | |
+ }, | |
+ "type": "array" | |
+ } | |
+ } | |
+ }, | |
+ "description": "A JSON array of user names" | |
} | |
}, | |
"summary": "Returns a list of users." | |
} | |
} | |
}, | |
- "schemes": [ | |
- "https" | |
- ], | |
- "swagger": "2.0" | |
+ "servers": [ | |
+ { | |
+ "description": "Optional server description, e.g. Main (production) server", | |
+ "url": "http://api.example.com/v1" | |
+ }, | |
+ { | |
+ "description": "Optional server description, e.g. Internal staging server for testing", | |
+ "url": "http://staging-api.example.com" | |
+ } | |
+ ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment