Исходный код вики Swagger Macro

Редактировал(а) Антон Славиковский 2026/03/05 12:27

Последние авторы
1 This macro allows to display [[OpenAPI>>https://swagger.io/specification/]] specifications directly in your wiki.
2
3 Example:
4
5
6 {{code}}
7 {{swagger displayOperationId="false" proxy="false" showCommonExtensions="false" displayRequestDuration="false" showExtensions="false"}}
8 openapi: 3.0.0
9 info:
10 title: Sample API
11 description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
12 version: 0.1.9
13
14 servers:
15 - url: http://api.example.com/v1
16 description: Optional server description, e.g. Main (production) server
17 - url: http://staging-api.example.com
18 description: Optional server description, e.g. Internal staging server for testing
19
20 paths:
21 /users:
22 get:
23 summary: Returns a list of users.
24 description: Optional extended description in CommonMark or HTML.
25 responses:
26 "200": # status code
27 description: A JSON array of user names
28 content:
29 application/json:
30 schema:
31 type: array
32 items:
33 type: string
34 {{/swagger}}
35 {{/code}}
36
37
38 {{swagger displayOperationId="false" proxy="false" showCommonExtensions="false" displayRequestDuration="false" showExtensions="false"}}
39 openapi: 3.0.0
40 info:
41 title: Sample API
42 description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
43 version: 0.1.9
44
45 servers:
46 - url: http://api.example.com/v1
47 description: Optional server description, e.g. Main (production) server
48 - url: http://staging-api.example.com
49 description: Optional server description, e.g. Internal staging server for testing
50
51 paths:
52 /users:
53 get:
54 summary: Returns a list of users.
55 description: Optional extended description in CommonMark or HTML.
56 responses:
57 "200": # status code
58 description: A JSON array of user names
59 content:
60 application/json:
61 schema:
62 type: array
63 items:
64 type: string
65 {{/swagger}}