source: ProjectBuilder/devel/pb-modules/etc/api.yaml@ 2623

Last change on this file since 2623 was 2623, checked in by Bruno Cornec, 4 years ago

Mojolicious OpenAPI plugin wants a .yaml file

File size: 3.9 KB
Line 
1---
2swagger: '2.0'
3info:
4 title: Project-Builder.org
5 description: PBSUMMARY
6 license:
7 name: General Public License 3.0
8 url: http://www.gnu.org/
9 #termsOfService: 'http://www.example.com/terms'
10 contact:
11 name: API Support
12 url: 'http://www.project-builder.org/support'
13 #email: support@example.com
14 version: 'PBAPIVER'
15host: localhost
16basePath: /api/vPBAPIVER
17schemes:
18 - http
19consumes:
20 - application/json
21 - application/yaml
22produces:
23 - application/json
24 - application/yaml
25# Global parameters
26paths:
27 /hello:
28 operationId: helloWorld
29 x-mojo-name: hello_world
30 x-mojo-to: example#hello_world
31 summary: Test entry point
32 responses:
33 '200':
34 description: Return hello
35 schema:
36 type: object
37 properties:
38 greetings:
39 type: string
40 default:
41 description: Unexpected error
42 schema:
43 $ref: '#/definitions/Error'
44 /doc:
45 get:
46 summary: API Documentation
47 operationId: docPb
48 tags:
49 - pb
50 responses:
51 '200':
52 description: Expected response to a valid request
53 schema:
54 $ref: '#/definitions/Conf'
55 default:
56 description: Unexpected error
57 schema:
58 $ref: '#/definitions/Error'
59 /prj:
60 get:
61 summary: List all projects
62 operationId: listPrjs
63 tags:
64 - prj
65 responses:
66 '200':
67 description: List of all projects managed by project-builder.org
68 schema:
69 $ref: '#/definitions/Prj'
70 default:
71 description: Unexpected error
72 schema:
73 $ref: '#/definitions/Error'
74 put:
75 summary: Create a new project
76 operationId: newPrj
77 tags:
78 - prj
79 parameters:
80 - name: name
81 in: body
82 description: Add project by name
83 required: true
84 schema:
85 $ref: '#/definitions/Prj'
86 responses:
87 '200':
88 description: Expected response to a valid request
89 schema:
90 $ref: '#/definitions/Prj'
91 '409':
92 description: Null response
93 schema:
94 $ref: '#/definitions/Error'
95 default:
96 description: Unexpected error
97 schema:
98 $ref: '#/definitions/Error'
99 '/conf/{prj}':
100 get:
101 summary: List all configuration parameters for a specific project
102 operationId: listConf
103 tags:
104 - conf
105 parameters:
106 - $ref: '#/parameters/prj'
107 responses:
108 '200':
109 description: Expected response to a valid request
110 schema:
111 items:
112 $ref: '#/definitions/Conf'
113 default:
114 description: Unexpected error
115 schema:
116 $ref: '#/definitions/Error'
117 '/conf/{prj}/{confname}':
118 get:
119 operationId: showConf
120 summary: Get a configuration item
121 tags:
122 - conf
123 parameters:
124 - $ref: '#/parameters/prj'
125 - name: confname
126 in: path
127 type: string
128 required: true
129 description: The name of the configuration item that will be queried
130 responses:
131 '200':
132 description: Expected response to a valid request
133 schema:
134 $ref: '#/definitions/Conf'
135 default:
136 description: Unexpected error
137 schema:
138 $ref: '#/definitions/Error'
139parameters:
140 prj:
141 name: prj
142 description: The name of the project that will be queried
143 required: true
144 in: path
145 type: string
146definitions:
147 Prj:
148 required:
149 - name
150 properties:
151 name:
152 type: string
153 tag:
154 type: string
155 Conf:
156 required:
157 - name
158 properties:
159 name:
160 type: string
161 tag:
162 type: string
163 Error:
164 required:
165 - code
166 - message
167 properties:
168 code:
169 type: integer
170 format: int32
171 message:
172 type: string
Note: See TracBrowser for help on using the repository browser.