-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSchemaConstants.php
More file actions
66 lines (62 loc) · 1.74 KB
/
SchemaConstants.php
File metadata and controls
66 lines (62 loc) · 1.74 KB
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
<?php
namespace WebmanTech\Swagger\DTO;
/**
* 用于定义 schema 用到的常量
*/
final class SchemaConstants
{
/**
* 命名路由
*/
public const X_NAME = 'route-name';
/**
* 路由 path
* 当 openapi 上的 path 不能满足时路由定义时使用
* 比如 /user/{id:\d+} 或 /user[/{name}],可以通过此设置
*/
public const X_PATH = 'route-path';
/**
* 路由中间件
*/
public const X_MIDDLEWARE = 'route-middleware';
/**
* 将 schema 转到 request 上
*/
public const X_SCHEMA_REQUEST = 'schema-request';
/**
* 将 schema 转到 response 上
*/
public const X_SCHEMA_RESPONSE = 'schema-response';
/**
* schema 组合类型
* 用于指定当多个 schema 组合时使用 allOf 还是 oneOf
* 可选值: 'allOf', 'oneOf'
*/
public const X_SCHEMA_COMBINE_TYPE = 'schema-combine-type';
/**
* response layout
*/
public const X_RESPONSE_LAYOUT = 'response-layout';
public const X_RESPONSE_LAYOUT_DATA_CODE = 'response-layout-data-code';
/**
* OA\Schema 的内部 x 参数名
* 暂存 schema 的验证规则,用于挂载到 Operation.description
*/
public const X_SCHEMA_VALIDATION_RULES = 'validation-rules';
/**
* OA\Property 的 x 中使用的 in 参数名
* 支持的值见
* @see RequestPropertyInEnum
*/
public const X_PROPERTY_IN = 'in';
/**
* OA\Property 的 x 中使用的 types 参数名
* 用于定义特定的类型
*/
public const X_PROPERTY_TYPES = 'types';
/**
* OA\Property 的 x 中使用的 discriminator 参数名
* 用于多态定义
*/
public const X_PROPERTY_DISCRIMINATOR = 'discriminator';
}