Skip to content

Instantly share code, notes, and snippets.

@darrylhebbes
Created April 10, 2014 16:36
Show Gist options
  • Save darrylhebbes/10400225 to your computer and use it in GitHub Desktop.
Save darrylhebbes/10400225 to your computer and use it in GitHub Desktop.
{
"apiVersion": "0.0.3",
"swaggerVersion": "1.2",
"basePath": "http://example.com/api",
"resourcePath": "/",
"produces": ["application/json"],
"apis": [
{
"path": "/image/{filename}",
"operations": [{
"method": "DELETE",
"summary": "Deletes an image",
"notes": "",
"type": "void",
"nickname": "deleteImage",
"authorizations": {},
"parameters": [{
"name": "filename",
"description": "Image file to delete",
"required": true,
"type": "string",
"paramType": "path",
"allowMultiple": false
}],
"responseMessages": [{
"code": 400,
"message": "Invalid image filename"
}]
}]
},
{
"path": "/image/upload",
"operations": [{
"method": "POST",
"summary": "uploads an image",
"notes": "",
"type": "void",
"nickname": "uploadFile",
"consumes": ["multipart/form-data"],
"authorizations": {},
"parameters": [{
"name": "file",
"description": "file to upload",
"required": true,
"type": "File",
"paramType": "body",
"allowMultiple": false
},{
"name": "session",
"description": "? Additional client session / cookie to pass to server",
"required": false,
"type": "string",
"paramType": "form",
"allowMultiple": false
}]
}]
},
{
"path": "/image/findBySession",
"operations": [{
"method": "GET",
"summary": "Finds Images by session",
"notes": "",
"type": "array",
"items": {
"$ref": "Image"
},
"nickname": "findImagesBySession",
"authorizations": {},
"parameters": [{
"name": "session",
"description": "? Server session of cookie",
"defaultValue": "",
"required": true,
"type": "string",
"paramType": "query"
}],
"responseMessages": [{
"code": 400,
"message": "Invalid session value"
}]
}]
},
{
"path": "/template/{deviceId}",
"operations": [{
"method": "GET",
"summary": "Find Template Page Definition (productTemplatePageDefs folder ) by deviceID eg iPhone 5 is M04721 ",
"notes": "Returns a template based on deviceID",
"type": "Template",
"nickname": "getTemplateByDeviceId",
"authorizations": {},
"parameters": [{
"name": "deviceId",
"description": "ID of Template Page Definition that needs to be fetched",
"required": true,
"type": "string",
"paramType": "path",
"allowMultiple": false
}],
"responseMessages": [{
"code": 400,
"message": "Invalid deviceID given"
}, {
"code": 404,
"message": "Template Page Definition not found"
}]
}]
},
{
"path": "/workspace/",
"operations": [{
"method": "POST",
"summary": "Add a new persisted session",
"notes": "Will eventually have a ONE to MANY relationship with logged in User",
"type": "string",
"nickname": "addWorkspace",
"consumes": ["application/json"],
"authorizations": {},
"parameters": [{
"name": "session",
"description": "? Server session of cookie",
"defaultValue": "",
"required": true,
"type": "string",
"paramType": "query"
},{
"name": "svg",
"description": "SVG XML string of the Canvas artwork, eventually used for PrePress processing",
"required": true,
"type": "string",
"paramType": "body",
"allowMultiple": false
},{
"name": "workspace_meta",
"description": "JSON string that represents the Canvas settings and various other meta data",
"required": true,
"type": "string",
"paramType": "body",
"allowMultiple": false
}],
"responseMessages": [{
"code": 400,
"message": "Invalid deviceID given"
}, {
"code": 405,
"message": "Invalid input"
}, {
"code": 440,
"message": "Session expired"
},{
"code": 200,
"message": " {'saveid': '1195259493-1904391998-1396876938553'} "
}]
}]
},
{
"path": "/workspace/",
"operations": [{
"method": "PUT",
"summary": "Update persisted session",
"notes": "Will eventually have a ONE to MANY relationship with logged in User",
"type": "void",
"nickname": "updateWorkspace",
"authorizations": {},
"parameters": [{
"name": "session",
"description": "Workspace that needs updating",
"defaultValue": "",
"required": true,
"type": "string",
"paramType": "query"
},{
"name": "svg",
"description": "SVG XML string of the Canvas artwork, eventually used for PrePress processing",
"required": true,
"type": "string",
"paramType": "body",
"allowMultiple": false
},{
"name": "workspace_meta",
"description": "JSON string that represents the Canvas settings and various other meta data",
"required": true,
"type": "string",
"paramType": "body",
"allowMultiple": false
}],
"responseMessages": [{
"code": 400,
"message": "Invalid deviceID given"
}, {
"code": 405,
"message": "Invalid input"
}, {
"code": 440,
"message": "Session expired"
},{
"code": 200,
"message": " {'updateid': '1195259493-1904391998-1396876938553'} "
}]
}]
},
{
"path": "/workspace/",
"operations": [{
"method": "GET",
"summary": "Get persisted session",
"notes": "Will eventually have a ONE to MANY relationship with logged in User",
"type": "Workspace",
"nickname": "getWorkspace",
"authorizations": {},
"parameters": [{
"name": "session",
"description": "Workspace that needs updating",
"defaultValue": "",
"required": true,
"type": "string",
"paramType": "query"
}],
"responseMessages": [{
"code": 440,
"message": "Session expired"
}]
}]
}],
"models": {
"Workspace": {
"id": "Workspace",
"required": ["session", "svg", "workspace_meta"],
"properties": {
"id": {
"type": "integer",
"format": "int64",
"description": "unique identifier for the pet",
"minimum": "0.0",
"maximum": "100.0"
},
"session": {
"type": "string"
},
"svg": {
"type": "string"
},
"workspace_meta": {
"type": "string"
}
}
},
"Template": {
"id": "Template",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"deviceId": {
"type": "string"
},
"filename": {
"type": "string"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment