Skip to content

Instantly share code, notes, and snippets.

@mox601
Created January 22, 2016 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mox601/13dd21c25d22c7ce84fa to your computer and use it in GitHub Desktop.
Save mox601/13dd21c25d22c7ce84fa to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"description": "Api Documentation",
"version": "1.0",
"title": "Api Documentation",
"termsOfService": "urn:tos",
"contact": {
"name": "Contact Email"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
},
"host": "localhost:8080",
"basePath": "/",
"tags": [{
"name": "articles",
"description": "Articles"
}, {
"name": "questions",
"description": "Questions"
}, {
"name": "basic-error-controller",
"description": "Basic Error Controller"
}],
"paths": {
"/articles": {
"post": {
"tags": ["articles"],
"summary": "create",
"operationId": "createUsingPOST",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"in": "body",
"name": "postDTO",
"description": "postDTO",
"required": true,
"schema": {
"$ref": "#/definitions/TaggedPostDTO"
}
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/TaggedPostDTO"
}
}
}
}
},
"/articles/{id}": {
"get": {
"tags": ["articles"],
"summary": "findById",
"operationId": "findByIdUsingGET",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"name": "id",
"in": "path",
"description": "id",
"required": true,
"type": "integer",
"format": "int64"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/TaggedPostDTO"
}
}
}
},
"put": {
"tags": ["articles"],
"summary": "update",
"operationId": "updateUsingPUT",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"in": "body",
"name": "post",
"description": "post",
"required": true,
"schema": {
"$ref": "#/definitions/TaggedPostDTO"
}
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/TaggedPostDTO"
}
}
}
},
"delete": {
"tags": ["articles"],
"summary": "delete",
"operationId": "deleteUsingDELETE",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"name": "id",
"in": "path",
"description": "id",
"required": true,
"type": "integer",
"format": "int64"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/error": {
"get": {
"tags": ["basic-error-controller"],
"summary": "errorHtml",
"operationId": "errorHtmlUsingGET",
"consumes": ["application/json"],
"produces": ["text/html"],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelAndView"
}
}
}
},
"head": {
"tags": ["basic-error-controller"],
"summary": "errorHtml",
"operationId": "errorHtmlUsingHEAD",
"consumes": ["application/json"],
"produces": ["text/html"],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelAndView"
}
}
}
},
"post": {
"tags": ["basic-error-controller"],
"summary": "errorHtml",
"operationId": "errorHtmlUsingPOST",
"consumes": ["application/json"],
"produces": ["text/html"],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelAndView"
}
}
}
},
"put": {
"tags": ["basic-error-controller"],
"summary": "errorHtml",
"operationId": "errorHtmlUsingPUT",
"consumes": ["application/json"],
"produces": ["text/html"],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelAndView"
}
}
}
},
"delete": {
"tags": ["basic-error-controller"],
"summary": "errorHtml",
"operationId": "errorHtmlUsingDELETE",
"consumes": ["application/json"],
"produces": ["text/html"],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelAndView"
}
}
}
},
"options": {
"tags": ["basic-error-controller"],
"summary": "errorHtml",
"operationId": "errorHtmlUsingOPTIONS",
"consumes": ["application/json"],
"produces": ["text/html"],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelAndView"
}
}
}
},
"patch": {
"tags": ["basic-error-controller"],
"summary": "errorHtml",
"operationId": "errorHtmlUsingPATCH",
"consumes": ["application/json"],
"produces": ["text/html"],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ModelAndView"
}
}
}
}
},
"/questions": {
"post": {
"tags": ["questions"],
"summary": "create",
"operationId": "createUsingPOST_1",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"in": "body",
"name": "questionDTO",
"description": "questionDTO",
"required": true,
"schema": {
"$ref": "#/definitions/QuestionDTO"
}
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/QuestionDTO"
}
}
}
}
},
"/questions/{id}": {
"get": {
"tags": ["questions"],
"summary": "findById",
"operationId": "findByIdUsingGET_1",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"name": "id",
"in": "path",
"description": "id",
"required": true,
"type": "integer",
"format": "int64"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/QuestionDTO"
}
}
}
},
"put": {
"tags": ["questions"],
"summary": "update",
"operationId": "updateUsingPUT_1",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"in": "body",
"name": "todoEntry",
"description": "todoEntry",
"required": true,
"schema": {
"$ref": "#/definitions/QuestionDTO"
}
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/QuestionDTO"
}
}
}
},
"delete": {
"tags": ["questions"],
"summary": "delete",
"operationId": "deleteUsingDELETE_1",
"consumes": ["application/json"],
"produces": ["*/*"],
"parameters": [{
"name": "id",
"in": "path",
"description": "id",
"required": true,
"type": "integer",
"format": "int64"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"ModelMap": {
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"ModelAndView": {
"properties": {
"empty": {
"type": "boolean"
},
"model": {
"type": "object"
},
"modelMap": {
"type": "object",
"additionalProperties": {
"type": "object"
}
},
"reference": {
"type": "boolean"
},
"view": {
"$ref": "#/definitions/View"
},
"viewName": {
"type": "string"
}
}
},
"TaggedPostDTO": {
"properties": {
"content": {
"type": "string"
},
"postId": {
"type": "integer",
"format": "int64"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"title": {
"type": "string"
},
"topicId": {
"type": "integer",
"format": "int64"
}
}
},
"QuestionDTO": {
"properties": {
"content": {
"type": "string"
},
"postId": {
"type": "integer",
"format": "int64"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"title": {
"type": "string"
},
"topicId": {
"type": "integer",
"format": "int64"
}
}
},
"View": {
"properties": {
"contentType": {
"type": "string"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment