Skip to content

Commit 3211e23

Browse files
authored
chore(deps): upgrading openapi-related tooling (#1212)
## 🧰 Changes This upgrades our OpenAPI tooling in order to pull in a fix for a serious performance issue we uncovered when dereferencing API definitions that make extensive use of circular references. Check out APIDevTools/json-schema-ref-parser#380 for details.
1 parent 6d82ad5 commit 3211e23

File tree

4 files changed

+44
-50
lines changed

4 files changed

+44
-50
lines changed

__tests__/commands/openapi/__snapshots__/inspect.test.ts.snap

+13-18
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,28 @@ polymorphism:
99
· #/components/schemas/error_APIKEY_EMPTY
1010
· #/components/schemas/error_APIKEY_MISMATCH
1111
· #/components/schemas/error_APIKEY_NOTFOUND
12+
· #/components/schemas/error_API_ACCESS_REVOKED
13+
· #/components/schemas/error_API_ACCESS_UNAVAILABLE
1214
· #/components/schemas/error_APPLY_INVALID_EMAIL
1315
· #/components/schemas/error_APPLY_INVALID_JOB
1416
· #/components/schemas/error_APPLY_INVALID_NAME
1517
· #/components/schemas/error_CATEGORY_INVALID
1618
· #/components/schemas/error_CATEGORY_NOTFOUND
1719
· #/components/schemas/error_CHANGELOG_INVALID
1820
· #/components/schemas/error_CHANGELOG_NOTFOUND
21+
· #/components/schemas/error_CUSTOMBLOCK_NOTFOUND
1922
· #/components/schemas/error_CUSTOMPAGE_INVALID
2023
· #/components/schemas/error_CUSTOMPAGE_NOTFOUND
2124
· #/components/schemas/error_DOC_INVALID
2225
· #/components/schemas/error_DOC_NOTFOUND
2326
· #/components/schemas/error_ENDPOINT_NOTFOUND
2427
· #/components/schemas/error_INTERNAL_ERROR
28+
· #/components/schemas/error_OWLBOT_INVALID
29+
· #/components/schemas/error_OWLBOT_NOT_ENABLED
30+
· #/components/schemas/error_OWLBOT_NOT_ENTERPRISE
2531
· #/components/schemas/error_PROJECT_NEEDSSTAGING
2632
· #/components/schemas/error_PROJECT_NOTFOUND
33+
· #/components/schemas/error_PROJECT_NOT_CHILD
2734
· #/components/schemas/error_RATE_LIMITED
2835
· #/components/schemas/error_REGISTRY_INVALID
2936
· #/components/schemas/error_REGISTRY_NOTFOUND
@@ -32,12 +39,14 @@ polymorphism:
3239
· #/components/schemas/error_SPEC_ID_INVALID
3340
· #/components/schemas/error_SPEC_INVALID
3441
· #/components/schemas/error_SPEC_INVALID_SCHEMA
42+
· #/components/schemas/error_SPEC_INVALID_SUPERHUB
3543
· #/components/schemas/error_SPEC_NOTFOUND
3644
· #/components/schemas/error_SPEC_TIMEOUT
3745
· #/components/schemas/error_SPEC_VERSION_NOTFOUND
3846
· #/components/schemas/error_UNEXPECTED_ERROR
3947
· #/components/schemas/error_VERSION_CANT_DEMOTE_STABLE
4048
· #/components/schemas/error_VERSION_CANT_REMOVE_STABLE
49+
· #/components/schemas/error_VERSION_CONFLICTING_FLAGS
4150
· #/components/schemas/error_VERSION_DUPLICATE
4251
· #/components/schemas/error_VERSION_EMPTY
4352
· #/components/schemas/error_VERSION_FORK_EMPTY
@@ -46,6 +55,7 @@ polymorphism:
4655
· #/components/schemas/error_VERSION_NOTFOUND
4756
· #/paths/~1api-specification/post/responses/400/content/application~1json/schema
4857
· #/paths/~1api-specification~1{id}/put/responses/400/content/application~1json/schema
58+
· #/paths/~1api-validation/post/responses/400/content/application~1json/schema
4959
· #/paths/~1categories/post/requestBody/content/application~1json/schema
5060
· #/paths/~1version/post/responses/400/content/application~1json/schema"
5161
`;
@@ -93,13 +103,8 @@ additionalProperties:
93103
· #/components/schemas/ParameterizedHeader/properties/parameters/additionalProperties
94104
95105
circularRefs:
96-
· #/components/schemas/BodyPart/properties/parent
97-
· #/components/schemas/MultiPart/properties/bodyParts/items
98106
· #/components/schemas/MultiPart/properties/parent
99-
· #/components/schemas/ZoneOffset/properties/rules
100-
· #/components/schemas/ZoneOffsetTransition/properties/offsetAfter
101-
· #/components/schemas/ZoneOffsetTransition/properties/offsetBefore
102-
· #/components/schemas/ZoneRules/properties/transitions/items"
107+
· #/components/schemas/ZoneOffset/properties/rules"
103108
`;
104109

105110
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.0/json/schema-…' (w/ [ 'additionalProperties', …(2) ]) 1`] = `
@@ -119,13 +124,8 @@ additionalProperties:
119124
· #/components/schemas/ParameterizedHeader/properties/parameters/additionalProperties
120125
121126
circularRefs:
122-
· #/components/schemas/BodyPart/properties/parent
123-
· #/components/schemas/MultiPart/properties/bodyParts/items
124127
· #/components/schemas/MultiPart/properties/parent
125128
· #/components/schemas/ZoneOffset/properties/rules
126-
· #/components/schemas/ZoneOffsetTransition/properties/offsetAfter
127-
· #/components/schemas/ZoneOffsetTransition/properties/offsetBefore
128-
· #/components/schemas/ZoneRules/properties/transitions/items
129129
130130
x-default: You do not use this.
131131
x-readme.code-samples: You do not use this.
@@ -138,13 +138,8 @@ x-readme.samples-languages: You do not use this.]
138138
exports[`rdme openapi inspect > feature reports > should generate a report for '@readme/oas-examples/3.0/json/schema-…' (w/ [ 'circularRefs', 'readme' ]) 1`] = `
139139
[SoftError:
140140
circularRefs:
141-
· #/components/schemas/BodyPart/properties/parent
142-
· #/components/schemas/MultiPart/properties/bodyParts/items
143141
· #/components/schemas/MultiPart/properties/parent
144142
· #/components/schemas/ZoneOffset/properties/rules
145-
· #/components/schemas/ZoneOffsetTransition/properties/offsetAfter
146-
· #/components/schemas/ZoneOffsetTransition/properties/offsetBefore
147-
· #/components/schemas/ZoneRules/properties/transitions/items
148143
149144
x-default: You do not use this.
150145
x-readme.code-samples: You do not use this.
@@ -288,8 +283,8 @@ exports[`rdme openapi inspect > full reports > should generate a report for @rea
288283
exports[`rdme openapi inspect > full reports > should generate a report for @readme/oas-examples/3.0/json/readme.json 1`] = `
289284
"Here are some interesting things we found in your API definition. 🕵️
290285
291-
· You are using 2 media types throughout your API: application/json and multipart/form-data
292-
· You have a total of 36 operations in your API.
286+
· You are using 3 media types throughout your API: application/json, multipart/form-data, and text/event-stream
287+
· You have a total of 39 operations in your API.
293288
· You are using a single security type throughout your API: http
294289
295290
🌲 OpenAPI Features

__tests__/helpers/github-workflow-schema.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,7 @@
311311
"types": {
312312
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onevent_nametypes",
313313
"description": "Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary.\nYou can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events.",
314-
"type": "array",
315-
"minItems": 1
314+
"oneOf": [{ "type": "array", "minItems": 1 }, { "type": "string" }]
316315
},
317316
"working-directory": {
318317
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun",

package-lock.json

+27-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"ignore": "^7.0.0",
5858
"js-yaml": "^4.1.0",
5959
"mime-types": "^3.0.1",
60-
"oas": "^26.0.1",
61-
"oas-normalize": "^13.0.1",
60+
"oas": "^27.0.0",
61+
"oas-normalize": "^14.0.0",
6262
"ora": "^8.1.1",
6363
"prompts": "^2.4.2",
6464
"semver": "^7.5.3",
@@ -77,7 +77,7 @@
7777
"@oclif/test": "^4.1.0",
7878
"@readme/better-ajv-errors": "^2.3.2",
7979
"@readme/eslint-config": "^14.3.0",
80-
"@readme/oas-examples": "^5.19.1",
80+
"@readme/oas-examples": "^6.0.0",
8181
"@rollup/plugin-commonjs": "^28.0.0",
8282
"@rollup/plugin-json": "^6.0.0",
8383
"@rollup/plugin-node-resolve": "^16.0.0",

0 commit comments

Comments
 (0)