Debian Codegraph @

examples/test_refs_basePath_API.yaml

raw symbols SCIP
1 swagger: '2.0'
2
3 ################################################################################
4 # API Information #
5 ################################################################################
6 info:
7 version: '1.0.0'
8 title: Test both cascading $refs and basePath
9 description: |
10 This definition use both cascading $refs and a "non empty" basePath
11
12 ################################################################################
13 # Host, Base Path, Schemes and Content Types #
14 ################################################################################
15 # The host (name or ip) serving the API
16 host: localhost:5000
17
18 # The base path on which the API is served, relative to the host. Will be prefixed to all paths. Used to control versioning
19 basePath: /api/
20
21 # The transfer protocol of the API
22 schemes:
23 - http
24 # Format of bodies a client can send (Content-Type)
25 consumes:
26 - application/json
27 # Format of the responses to the client (Accepts)
28 produces:
29 - application/json
30
31 ################################################################################
32 # Paths #
33 ################################################################################
34 paths:
35 /get_cost:
36 post:
37 summary: a test with cascading $refs
38 consumes:
39 - application/json
40 produces:
41 - application/json
42 parameters:
43 - in: body
44 name: request
45 description: request
46 required: true
47 schema:
48 $ref: '#/definitions/GetCostRequest'
49 responses:
50 '200':
51 description: OK
52 schema:
53 type: array
54 items:
55 $ref: '#/definitions/GetCostResponse'
56 '201':
57 description: Created
58 '401':
59 description: Unauthorized
60 '403':
61 description: Forbidden
62 '404':
63 description: Not Found
64 deprecated: false
65 definitions:
66 GetCostResponse:
67 type: object
68 properties:
69 description:
70 type:
71 string
72 cost:
73 $ref: '#/definitions/Cost'
74 title: GetCost response
75 GetCostRequest:
76 type: object
77 properties:
78 level:
79 type: integer
80 location:
81 $ref: '#/definitions/Location'
82 title: GetCost Request
83 Cost:
84 type: object
85 properties:
86 currency:
87 type: string
88 description: cost currency (3-letters code)
89 value:
90 type: number
91 description: cost value
92 title: Cost
93 GeoPosition:
94 type: object
95 properties:
96 latitude:
97 type: number
98 format: double
99 description: latitude in float
100 longitude:
101 type: number
102 format: double
103 description: longitude in float
104 title: GeoPosition
105 Location:
106 type: object
107 properties:
108 name:
109 type: string
110 description: name of the location
111 position:
112 description: position of the location
113 $ref: '#/definitions/GeoPosition'
114 title: Location