A simple API Mockup tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

129 lines
3.0 KiB

{
"swagger": "2.0",
"info": {
"title": "Mockup (__THINGS__)",
"description": "A simple API Mock that manages __THINGS__",
"contact": {
"name": "Nicolas Massé",
"url": "https://github.com/nmasse-itix/API-Mockup"
},
"license": {
"name": "MIT License",
"url": "https://opensource.org/licenses/MIT"
},
"version": "1.0.0"
},
"paths": {
"/__THINGS__/": {
"get": {
"summary": "Get all __THINGS__",
"description": "Get all the __THINGS__.",
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"type": "#/definitions/PersistedThing"
}
}
}
}
},
"post": {
"summary": "Create a __THINGS__",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/Thing"
}
}
],
"responses": {
"201": {
"description": "Success",
"schema": {
"$ref": "#/definitions/PersistedThing"
}
}
}
}
},
"/__THINGS__/{id}": {
"get": {
"summary": "Get a __THINGS__ by id",
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/PersistedThing"
}
}
}
},
"put": {
"summary": "Update a __THINGS__",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/PersistedThing"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/PersistedThing"
}
}
}
},
"delete": {
"summary": "Delete a __THINGS__",
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/PersistedThing"
}
}
}
},
"parameters": [
{
"name": "id",
"in": "path",
"description": "The __THINGS__ id",
"required": true,
"type": "integer"
}
]
}
},
"definitions": {
"Thing": {
"title": "Definition of __THINGS__",
"description": "All __THINGS__ follow this definition",
"type": "object",
"properties": { }
},
"PersistedThing": {
"title": "Definition of persisted __THINGS__",
"description": "All persisted __THINGS__ follow this definition",
"type": "object",
"properties": {
"id": {
"format": "int32",
"description": "The __THINGS__ id",
"type": "integer",
"required": true
}
}
}
}
}