source: ProjectBuilder/devel/pb-server/api.json@ 2077

Last change on this file since 2077 was 2077, checked in by Bruno Cornec, 8 years ago

First attempt to add a Mojolicious web app with swagger providing a RESTful API for pb

File size: 2.9 KB
Line 
1{
2 "swagger": "2.0",
3 "info": { "title": "Project-Builder.org", "description": "PBSUMMARY", "version": "PBVER" },
4 "consumes": [ "application/json" ],
5 "produces": [ "application/json" ],
6 "host": "localhost",
7 "schemes": [ "http" ],
8 "basePath": "/v1",
9 "paths": {
10 "/conf": {
11 "get": {
12 "operationId": "listConf",
13 "parameters": [],
14 "responses": {
15 "200": {
16 "description": "Success",
17 "schema": {
18 "type": "array",
19 "items": { "$ref": "#/definitions/Entry" }
20 }
21 },
22 "default": {
23 "description": "Error.",
24 "schema": { "$ref": "http://git.io/vcKD4#" }
25 }
26 }
27 }
28 },
29 "/confs/{id}": {
30 "get": {
31 "operationId": "showConf",
32 "parameters": [
33 { "$ref": "#/parameters/entry_id" }
34 ],
35 "responses": {
36 "200": {
37 "description": "Success",
38 "schema": { "$ref": "#/definitions/Entry" }
39 },
40 "default": {
41 "description": "Error.",
42 "schema": { "$ref": "https://raw.githubusercontent.com/jhthorsen/swagger2/master/lib/Swagger2/error.json" }
43 }
44 }
45 },
46 "put": {
47 "operationId": "updateConf",
48 "parameters": [
49 { "$ref": "#/parameters/entry_id" },
50 { "$ref": "#/parameters/entry" }
51 ],
52 "responses": {
53 "200": {
54 "description": "Success",
55 "schema": { "$ref": "#/definitions/Void" }
56 },
57 "default": {
58 "description": "Error.",
59 "schema": { "$ref": "https://raw.githubusercontent.com/jhthorsen/swagger2/master/lib/Swagger2/error.json" }
60 }
61 }
62 },
63 "delete": {
64 "operationId": "removeConf",
65 "parameters": [
66 { "$ref": "#/parameters/entry_id" }
67 ],
68 "responses": {
69 "200": {
70 "description": "Success",
71 "schema": { "$ref": "#/definitions/Void" }
72 },
73 "default": {
74 "description": "Error.",
75 "schema": { "$ref": "https://raw.githubusercontent.com/jhthorsen/swagger2/master/lib/Swagger2/error.json" }
76 }
77 }
78 }
79 }
80 },
81 "parameters": {
82 "entry": {
83 "name": "entry",
84 "in": "body",
85 "required": true,
86 "schema": {
87 "$ref": "#/definitions/Entry"
88 },
89 "description": "A conf item"
90 },
91 "entry_id": {
92 "name": "id",
93 "in": "path",
94 "required": true,
95 "type": "integer",
96 "description": "A blog id"
97 }
98 },
99 "definitions": {
100 "Entry": {
101 "required": [ "body", "title" ],
102 "properties": {
103 "id": { "type": "integer" },
104 "body": { "type": "string" },
105 "title": { "type": "string" }
106 }
107 },
108 "Void": {
109 "properties": {}
110 }
111 }
112}
Note: See TracBrowser for help on using the repository browser.