forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
operation-schema.js
68 lines (67 loc) · 1.82 KB
/
operation-schema.js
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
#!/usr/bin/env node
// This schema is used to validate each generated operation object at build time
export default {
type: 'object',
required: [
'title',
'verb',
'requestPath',
'category',
'parameters',
'statusCodes',
'codeExamples',
],
properties: {
// Properties from the source OpenAPI schema that this module depends on
title: {
description: 'The title of the operation',
type: 'string',
},
verb: {
description: 'The HTTP method',
type: 'string',
enum: ['get', 'put', 'post', 'delete', 'patch', 'head'],
},
requestPath: {
description: 'The URL path',
type: 'string',
minLength: 1,
},
descriptionHTML: {
description: 'The rendered HTML version of the markdown `description` property',
type: 'string',
},
category: {
description: 'the `issues` in `/v3/issues/events/`; supports legacy developer site URLs',
type: 'string',
},
subcategory: {
description: 'the `events` in `/v3/issues/events/`; supports legacy developer site URLs',
type: 'string',
},
parameters: {
description: 'Parameters to the operation that can be present in the URL path or query',
type: 'array',
},
codeSamples: {
description: 'Code samples for the operation',
type: 'array',
},
statusCodes: {
description: 'The possible HTTP status codes for the operation',
type: 'array',
},
previews: {
description: 'The information about the preview headers',
type: 'array',
},
enabledForGitHubApps: {
description: 'Whether the operation is enabled for server-to-server GitHub Apps',
type: 'boolean',
},
bodyParameters: {
description: 'The request body parameters for the operation',
type: 'array',
},
},
}