forked from zircote/swagger-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
using-refs.yaml
95 lines (95 loc) · 2.47 KB
/
using-refs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
openapi: 3.0.0
info:
title: 'Example of using references in swagger-php'
version: 1.0.0
paths:
'/products/{product_id}':
get:
tags:
- Products
operationId: 'UsingRefs\ProductController::getProduct'
responses:
default:
description: 'successful operation'
content:
application/json:
schema:
$ref: '#/components/responses/product'
patch:
tags:
- Products
operationId: 'UsingRefs\ProductController::updateProduct'
requestBody:
$ref: '#/components/requestBodies/product_in_body'
responses:
default:
description: 'successful operation'
content:
application/json:
schema:
$ref: '#/components/responses/product'
parameters:
-
$ref: '#/components/parameters/product_id_in_path_required'
/products:
post:
tags:
- Products
operationId: 'UsingRefs\ProductController::addProduct'
parameters:
-
$ref: '#/components/requestBodies/product_in_body'
responses:
default:
description: 'successful operation'
content:
application/json:
schema:
$ref: '#/components/responses/product'
components:
schemas:
Product:
title: 'Product model'
description: 'Product model'
properties:
id:
description: 'The unique identifier of a product in our catalog.'
type: integer
format: int64
example: 1
status:
$ref: '#/components/schemas/product_status'
type: object
product_status:
description: 'The status of a product'
type: string
default: available
enum:
- available
- discontinued
responses:
product:
description: 'All information about a product'
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
todo:
description: 'This API call has no documentated response (yet)'
parameters:
product_id_in_path_required:
name: product_id
in: path
description: 'The ID of the product'
required: true
schema:
type: integer
format: int64
requestBodies:
product_in_body:
description: product_request
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Product'