...
1swagger: '2.0'
2info:
3 title: test example
4 version: "1.0.0"
5produces:
6 - application/json
7paths:
8 /v1/broker/{customer_id}:
9 get:
10 #operationId: a
11 parameters:
12 - $ref: "#/parameters/customerIdParam"
13 responses:
14 200:
15 # in line example
16 description: Customer
17 schema:
18 type: object
19 properties:
20 id:
21 type: string
22 format: uuid
23 email:
24 type: string
25 format: email
26 create_date:
27 type: string
28 format: date-time
29 examples:
30 application/json:
31 id: mycustomer
32 email: mycustomer@ripoffpark.com
33 create_date: bad-date
34 /v1/vendor/{customer_id}:
35 get:
36 #operationId: b
37 parameters:
38 - $ref: "#/parameters/customerIdParam"
39 responses:
40 200:
41 description: Customer
42 schema:
43 $ref: '#/definitions/customer2'
44 /v1/customer/{customer_id}:
45 get:
46 #operationId: c
47 parameters:
48 - $ref: "#/parameters/customerIdParam"
49 responses:
50 200:
51 description: Customer
52 schema:
53 $ref: '#/definitions/customer'
54parameters:
55 customerIdParam:
56 name: customer_id
57 description: The ID of the customer
58 in: path
59 required: true
60 type: string
61 format: uuid
62 example: xyz #<---- example not allowed here
63definitions:
64 # example property by property
65 customer:
66 type: object
67 required:
68 - id
69 properties:
70 id:
71 type: string
72 format: uuid
73 description: The unique ID of the customer
74 example: 123
75 email:
76 type: string
77 format: email
78 description: The email address of the customer
79 example: 123
80 create_date:
81 type: string
82 format: date-time
83 description: The date and time when the customer was created
84 example: 123
85 # example at object level
86 customer2:
87 type: object
88 required:
89 - id
90 properties:
91 id:
92 type: string
93 format: uuid
94 description: The unique ID of the customer
95 email:
96 type: string
97 format: email
98 description: The email address of the customer
99 create_date:
100 type: string
101 format: date-time
102 description: The date and time when the customer was created
103 example:
104 id: 'mycustomer'
105 email: 'mycustomer@ripoffpark.com'
106 create_date: bad-date
View as plain text