Created
October 18, 2018 14:12
-
-
Save yringler/700aaa11f4155ddc6644a43ca6ca5de1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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": "Virtual Path API", | |
| "description": "How to use the API for creating and querying virtual paths on Shluchim sites.", | |
| "version": "0.0.1" | |
| }, | |
| "servers": [ | |
| { | |
| "url": "https://www.chabadone.org", | |
| "description": "Main production server" | |
| } | |
| ], | |
| "paths": { | |
| "/api/v2/virtualpaths": { | |
| "get": { | |
| "summary": "Returns all virtual paths associated with the Mosad", | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/mosadId" } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "All virtual paths which are set up with the requested Mosad", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/virtualPathCollection" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "post": { | |
| "summary": "Create another virtual path", | |
| "parameters": [ | |
| { "$ref": "#/components/parameters/mosadId" } | |
| ], | |
| "requestBody": { | |
| "description": "A virtual path to be created.", | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/virtualPath" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "201": { | |
| "description": "A virtual path was created" | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "components": { | |
| "schemas": { | |
| "virtualPath": { | |
| "title": "Virtual Path", | |
| "properties": { | |
| "virtual-path": { | |
| "type": "string", | |
| "description": "The virtual path which should redirect.", | |
| "example": "/summer" | |
| }, | |
| "target-path": { | |
| "type": "string", | |
| "example": "/sections/summer/camp/signup.asp", | |
| "description": "Where the virtual path should redirect to." | |
| }, | |
| "target-article-id": { | |
| "type": "integer", | |
| "description": "The article id which this virtual path should redirect to.", | |
| "example": 8872 | |
| } | |
| } | |
| }, | |
| "virtualPathCollection": { | |
| "title": "Virtual Path Collection", | |
| "type": "array", | |
| "description": "Collection of virtual paths", | |
| "items": { | |
| "$ref": "#/components/schemas/virtualPath" | |
| } | |
| } | |
| }, | |
| "parameters": { | |
| "mosadId": { | |
| "name": "mosad-id", | |
| "in": "path", | |
| "required": true, | |
| "description": "The ID of the mosad", | |
| "schema": { | |
| "type": "integer", | |
| "minimum": 0 | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment