-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprotobuf2swagger.config.js
116 lines (115 loc) · 3.66 KB
/
protobuf2swagger.config.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
module.exports = {
// ERQU
files: [
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/phenopackets.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/base.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/biosample.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/disease.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/genome.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/individual.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/interpretation.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/measurement.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/medical_action.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/meta_data.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/pedigree.proto',
'phenopacket-schema/src/main/proto/phenopackets/schema/v2/core/phenotypic_feature.proto',
],
// Optional
dist: 'apischema.json',
// Optional
formatServicePath: (path) => path.replace(/\./g, '/'),
// Optional, will convert long to string by default
long: 'number',
// Optional
// This will merge and overwrite the result parsed from protobuffer file.
// `paths` will merge by path
// `components` will merge by component except shcemas
customSchema: {
swagger: '2.0',
paths: {
'/api/v1/phenopacket': {
get: {
responses: {
200: {
schema: {
"$ref": "#/definitions/org.phenopackets.schema.v2.Phenopacket"
},
},
},
parameters: [
{
"name": "hash",
"in": "query",
"description": "ID of phenopacket to return",
"required": true,
"schema": {
"type": "string",
}
}
],
},
post: {
requestBody: {
description: "Phenopacket",
schema: {
"$ref": "#/definitions/org.phenopackets.schema.v2.Phenopacket"
}
},
parameters: [
{
in: "body",
name: "body",
description: "phenopacket",
schema: {
"$ref": "#/definitions/org.phenopackets.schema.v2.Phenopacket"
}
}
],
responses: {
201: {
schema: {
"$ref": "#/definitions/org.phenopackets.schema.v2.Phenopacket"
},
},
},
},
},
'/api/v1/phenopacket/{id}': {
get: {
responses: {
200: {
schema: {
"$ref": "#/definitions/org.phenopackets.schema.v2.Phenopacket"
},
},
},
parameters: [
{
"name": "id",
"in": "path",
"description": "ID of phenopacket to return",
"required": true,
"schema": {
"type": "string",
}
}
],
},
},
},
components: {
securitySchemes: {
cookieAuth: {
type: 'apiKey',
in: 'cookie',
name: 'token',
},
},
},
security: [
{
cookieAuth: [],
},
],
}
};