-
Notifications
You must be signed in to change notification settings - Fork 26
/
redocly.yaml
565 lines (543 loc) · 13 KB
/
redocly.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
apis:
core@public:
root: openapi/openapi.yaml
output: docs/dev-docs/api/index.yaml
metadata:
description: The most common APIs used to automate common workflows.
decorators:
filter-in:
property: x-products
value:
- Core
plugin/change-title:
title: Core APIs
core@latest:
root: openapi/openapi.yaml
output: catalog/core.yaml
metadata:
description: The most common APIs used to automate common workflows.
decorators:
filter-in:
property: x-products
value:
- Core
plugin/change-title:
title: Core APIs
all@latest:
root: openapi/openapi.yaml
output: catalog/all.yaml
metadata:
description: All Rebilly APIs.
decorators:
plugin/remove-tag-groups: on
plugin/change-title:
title: All APIs
all@3.0:
root: openapi/openapi.yaml
output: catalog/all-3.0.yaml
metadata:
description: All Rebilly APIs.
decorators:
plugin/remove-tag-groups: on
plugin/change-title:
title: All APIs
plugin/backport-to-30: on
storefront@latest:
root: openapi/openapi.yaml
output: catalog/storefront.yaml
metadata:
description: APIs intended to be used directly from an untrusted browser.
decorators:
filter-in:
property: x-products
value:
- Storefront
plugin/change-title:
title: Storefront APIs
plugin/remove-tag-groups: on
plugin/remove-unused-tags: on
reports@latest:
root: openapi/openapi.yaml
output: catalog/reports.yaml
metadata:
description: APIs for reporting purposes.
decorators:
filter-in:
property: x-products
value:
- Reports
plugin/change-title:
title: Reports APIs
plugin/remove-tag-groups: on
plugin/remove-unused-tags: on
combined@latest:
root: openapi/openapi.yaml
output: catalog/combined.yaml
metadata:
description: Combined APIs for who knows what. Maybe we can remove this since we have "All"?
decorators:
filter-in:
property: x-products
value:
- Combined
plugin/change-title:
title: Combined APIs
plugin/remove-tag-groups: on
plugin/remove-unused-tags: on
users@latest:
root: openapi/openapi.yaml
output: catalog/users.yaml
metadata:
description: Users APIs for who knows what. Maybe we can remove this since we have "All"?
decorators:
filter-in:
property: x-products
value:
- Users
plugin/change-title:
title: Users APIs
plugin/remove-tag-groups: on
plugin/remove-unused-tags: on
extends:
- recommended
plugins:
- ./plugins/custom-rules.js
- ./plugins/decorators.js
- ./plugins/products-bundler/bundler.js
rules:
no-ambiguous-paths: error
no-unused-components: error
operation-2xx-response: error
operation-operationId: error
operation-singular-tag: error
operation-tag-defined: error
operation-4xx-response: off
paths-kebab-case: error
tags-alphabetical:
severity: error
ignoreCase: true
request-mime-type:
severity: error
allowedValues:
- application/json
response-mime-type:
severity: error
allowedValues:
- application/json
- application/pdf
- application/zip
- image/jpg
- image/png
- image/gif
- text/csv
# Opened a ticket:
# response-contains-property:
# severity: error
# names:
# '2XX':
# - createdTime
# - updatedTime
# - id
# - _links
# '4XX':
# - type
# - status
# - title
rule/response-contains-property:
severity: off
subject:
type: SchemaProperties
where:
- subject:
type: Response
filterInParentKeys:
- '200'
- '201'
- '202'
assertions:
defined: true
- subject:
type: Schema
property: type
assertions:
const: object
assertions:
required:
- id
- _links
rule/response-error-contains-property:
severity: off
subject:
type: SchemaProperties
where:
- subject:
type: Response
filterInParentKeys:
- '422'
- '400'
- '409'
assertions:
defined: true
- subject:
type: Schema
property: type
assertions:
const: object
assertions:
required:
- type
- status
- title
path-segment-plural:
severity: error
ignoreLastPathSegment: true
exceptions:
- storefront
- experimental
- tracking
- profile
- verification
- reset-password
- account
- events-triggered
- status
- send-through-attribution
- permissions-emulation
- logout
- onboarding
- timeline
- edd-timeline
- forgot-password
- history
- search
- ready-to-pay
- aml
- api
- upcoming-invoice
custom-rules/no-unused-tags: error
custom-rules/sibling-ref: error
response-contains-header:
severity: error
names:
'201':
- Location
'303':
- Location
no-invalid-schema-examples: error
no-invalid-media-type-examples: error
no-invalid-parameter-examples: error
no-server-example.com: error
no-http-verbs-in-paths:
severity: error
splitIntoWords: true
boolean-parameter-prefixes: error
parameter-description: error
## custom rules
### Examples
rule/params-must-include-examples:
severity: off
subject:
type: Parameter
assertions:
requireAny:
- example
- examples
mutuallyExclusive:
- example
- examples
rule/headers-include-example:
subject:
type: Header
property: example
assertions:
defined: true
nonEmpty: true
rule/path-must-be-ref-file:
subject:
type: PathItem
where:
- subject:
type: Paths
assertions:
defined: true
assertions:
ref: /^(.\/paths|paths)\/[a-z{].*yaml$/
rule/x-sdk-operation-name:
where:
- subject:
type: Paths
assertions:
defined: true
subject:
type: Operation
property: x-sdk-operation-name
assertions:
casing: camelCase
defined: true
rule/operation-id-delete:
where:
- subject:
type: Operation
filterInParentKeys:
- delete
assertions:
defined: true
subject:
type: Operation
property: operationId
assertions:
pattern: /Delete/
casing: PascalCase
rule/operation-id-get:
where:
- subject:
type: Operation
filterInParentKeys:
- get
assertions:
defined: true
subject:
type: Operation
property: operationId
assertions:
pattern: /Get/
casing: PascalCase
rule/operation-id-patch:
where:
- subject:
type: Operation
filterInParentKeys:
- patch
assertions:
defined: true
subject:
type: Operation
property: operationId
assertions:
pattern: /Patch/
rule/operation-id-post:
where:
- subject:
type: Paths
assertions:
defined: true
- subject:
type: Operation
filterInParentKeys:
- post
assertions:
defined: true
subject:
type: Operation
property: operationId
assertions:
pattern: /Post/
casing: PascalCase
rule/operation-id-put:
where:
- subject:
type: Operation
filterInParentKeys:
- put
assertions:
defined: true
subject:
type: Operation
property: operationId
assertions:
pattern: /Put/
casing: PascalCase
rule/operation-summary:
subject:
type: Operation
property: summary
where:
- subject:
type: Paths
assertions:
defined: true
assertions:
defined: true
minLength: 10
maxLength: 50
pattern: /^(Retrieve|Create|Delete|Upsert|Preview|Send|Update|Register|Destroy|Trigger|Start|Stop|Skip|Set|Check|Enable|Disable|Close|Request|Resend|Verify|List|Patch|Activate|Refund|Query|Validate|Tag|Untag|Issue|Reactivate|Cancel|Pause|Change|Void|Search|Get|Modify|Finish|Schedule|Read|Reset|Make|Deactivate|Perform|Review|Reject|Accept|Apply|Partially|Re|Abandon|Download|Merge|Specify|Redeem|Exchange|Log|Sync).*[^\.]$/
### Description rules
rule/tag-description:
subject:
type: Tag
property: description
assertions:
defined: true
rule/description-capitalization:
subject:
type: any
property: description
assertions:
pattern: /^([A-Z]|#+ [A-Z]|dLocal|ecoPayz|eMerchantPay|ePay|eZeeWallet|ezyEFT|iCanPay|iCheque|iDebit|loonie|vegaaH|gate2way)/
rule/description-punctuation:
subject:
type: any
property: description
assertions:
pattern: /(\.\n?|server)$/
rule/no-anthropomorphic-possessives:
subject:
type: any
property: description
assertions:
notPattern: /(Rebilly's|subscription's|invoice's|item's|order's|product's|transaction's|document's|payment's|payout's|card's|instrument's)/i
rule/no-description-start-with-the-a-an:
subject:
type: any
property: description
assertions:
notPattern: /^(The\s|A\s|An\s)/
rule/no-past-future:
subject:
type: any
property: description
assertions:
notPattern: /(was\s|were\s|will\s)/
rule/info-description:
subject:
type: Info
property: description
assertions:
defined: true
minLength: 30
rule/schema-properties-both-created-time-and-updated-time:
subject:
type: SchemaProperties
assertions:
mutuallyRequired:
- createdTime
- updatedTime
rule/schema-properties-camelCase:
where:
- subject:
type: SchemaProperties
property: credentials
assertions:
defined: false
- subject:
type: SchemaProperties
assertions:
notPattern: ^(_embedded|_links|q|25th|50th|75th|3ds)$
subject:
type: SchemaProperties
assertions:
casing: camelCase
rule/put-200-and-201:
subject:
type: Responses
where:
- subject:
type: Operation
filterInParentKeys:
- put
assertions:
defined: true
message: Must mutually define 200 and 201 responses for PUT requests.
severity: warn
assertions:
mutuallyRequired:
- '200'
- '201'
rule/no-x-code-samples:
subject:
type: Operation
assertions:
disallowed:
- x-code-samples
rule/no-x-internal:
subject:
type: Operation
message: This is in a public repository. Do not include internal APIs.
assertions:
disallowed:
- x-internal
rule/embedded-is-object:
severity: error
subject:
type: Schema
property: type
filterInParentKeys:
- _embedded
assertions:
const: object
# Need to account for arrays, etc...
# rule/mediatype-schema-ref-pattern:
# subject: MediaType
# property: schema
# message: Ref needs to point to components directory.
# ref: /^(\.\.\/)?(components|schemas)\/.*\.yaml$/
decorators:
products-bundler/bundle: error
plugin/remove-php-sample-prefix: on
theme:
openapi:
pagination: item
theme:
logo:
gutter: 20px 30px 14px 30px
colors:
primary:
main: '#0044D4'
text:
primary: '#0D2B3E'
typography:
headings:
fontFamily: Roboto
fontFamily: 'Roboto, Verdana, Geneva, sans-serif'
fontSize: 14px
code:
fontFamily: '"Courier New",monospace'
rightPanelHeading:
color: white
rightPanel:
backgroundColor: '#505A6F'
codeBlock:
backgroundColor: '#0D2B3E'
links:
color: '#6CC496'
htmlTemplate: ./web/index.html
generateCodeSamples:
languages:
- lang: curl
- lang: Node.js
- lang: Ruby
- lang: C#
- lang: Go
- lang: Python
- lang: Java
schemaExpansionLevel: '2'
maxDisplayedEnumValues: 10
hideTryItPanel: false
expandResponses: '200,201'
requiredPropsFirst: true
catalog:
rebilly-catalog:
title: Rebilly API catalog
description: Discover how our APIs can support your business.
slug: /catalog/
items:
- directory: ./catalog
flatten: true
includeByMetadata:
type: [openapi]
navbar:
items:
- page: /catalog/
label: Catalog
- page: /contributing/
label: Contributing
logo:
altText: Rebilly API catalog
image: ./web/rb_apiLogo.svg
ignore:
- '.github' # works
# - 'openapi'
- 'plugins'
- 'web'
# - 'CONTRIBUTING.md'
# - 'README.md'