Commit ec3099c
feat(oas): v30 release (#1053)
## 🐳 Context
Because we are experience some pretty serious performance issues with
large API definitions post-dereferencing we are adding general support
for handling `$ref` pointers into `oas`, without requiring the need for
a full dereference.
> [!IMPORTANT]
> This is a major breaking change to `oas`. Because `oas` has long
assumed that the OpenAPI definition it contained was dereferenced this
is a huge shift in departure so I expect there to be issues, and as such
will be releasing this in v30 RCs until it's stable.
## 📚 Accompanied work
* [x] #1052
* [x] #1051
* [x] #1054
* [x] #1055
## 🧠 Breaking changes
* [x] Enforced TS strict mode everywhere. Some function return types
have changed as a result of this but only to enforce what these methods
were already returning.
#### `oas`
* [x] Improved support for `$ref` pointers on the following accessors:
* `.getAuth()`
* `.getPaths()`
* `.getWebhooks()`
#### `oas/operation`
* [x] `.dereference()`. This is a new alternative to `Oas.dereference()`
and allows you to dereference a single operation, rather than needing to
dereference the **entire** API definition.
* [x] `.getCallbacks()` now always returns an array. Previously if the
operation had no callbacks it would return `false`, however that
existence check is better suited for `Operation.hasCallbacks()`.
#### `oas/types`
* [x] `isOAS30` has been removed, please use `isOpenAPI30` instead.
* [x] `isOAS31` has been removed, please use `isOpenAPI31` instead.
#### `oas/utils`
* [ ] `findSchemaDefinition` is no longer exported. If you need to
dereference a `$ref` pointer we suggest you either invoke
`Oas.dereference()` to dereference your entire API definition, use the
new `Operation.dereference()` feature in this release for dereferencing
a single API operation, or use a library like
[@apidevtools/json-schema-ref-parser](https://npm.im/@apidevtools/json-schema-ref-parser)
for dereferencing.
## 🧬 QA & Testing
I've written a good amount of new tests for these changes but the real
Q&A will have to be done within our internal repository, and I expect
this work as-is to contain issues so I'll be tagging RC's until it's
fully ready for the general public.
[^1]: Unless explicitly specified otherwise, `$ref` pointers that cannot
be resolved, either because they are invalid or circular, will be
ignored.
---------
Co-authored-by: Darren Yong <contact.darrenyong@gmail.com>
Co-authored-by: Maximilian Falco Widjaya <maximilianfalco@gmail.com>
Co-authored-by: Darren Yong <41130056+darrenyong@users.noreply.github.com>1 parent 636f0e2 commit ec3099c
File tree
47 files changed
+2789
-2058
lines changed- packages
- oas-to-har/src
- oas
- src
- lib
- operation
- lib
- reducer
- samples
- test
- __snapshots__
- analyzer/queries
- lib
- openapi-to-json-schema
- operation
- lib
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
47 files changed
+2789
-2058
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
| 424 | + | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 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 | | - | |
| 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 | + | |
252 | 254 | | |
253 | 255 | | |
254 | | - | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| |||
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
380 | 386 | | |
381 | 387 | | |
382 | 388 | | |
| |||
0 commit comments