You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// do anything you want here to determine what key the new component should be stored at.
372
+
//
371
373
// for the example, we will just transform the URL path into a valid components key:
372
374
let urlString = url.pathComponents
373
375
.joined(separator: "_")
@@ -386,7 +388,7 @@ In addition to looking something up in the [`Components`](https://mattpolzin.git
386
388
387
389
You use a value's [`dereferenced(in:)`](https://mattpolzin.github.io/OpenAPIKit/documentation/openapikit/locallydereferenceable) method to fully dereference it.
388
390
389
-
You can even dereference the whole document with the `OpenAPI.Document``locallyDereferenced()` method. As the name implies, you can only derefence whole documents that are contained within one file (which is another way of saying that all references are "local"). Specifically, all references must be located within the document's Components Object. External dereferencing is done as a separeate step, but you can first dereference externally and then dereference internally if you'd like to perform both.
391
+
You can even dereference the whole document with the `OpenAPI.Document``locallyDereferenced()` method. As the name implies, you can only derefence whole documents that have previously been externally dereferenced (or documents contained within one file) -- that is, all references are "local". Specifically, all references must be located within the document's Components Object. External dereferencing is done as a separeate step, but you can first dereference externally and then dereference internally if you'd like to perform both.
390
392
391
393
Unlike what happens when you lookup an individual component using the `lookup()` method on `Components`, dereferencing a whole `OpenAPI.Document` will result in type-level changes that guarantee all references are removed. `OpenAPI.Document`'s `locallyDereferenced()` method returns a `DereferencedDocument` which exposes `DereferencedPathItem`s which have `DereferencedParameter`s and `DereferencedOperation`s and so on.
392
394
@@ -458,7 +460,7 @@ The [**Swift Package Registry API Docs**](https://github.com/mattt/swift-package
458
460
[**OpenAPIDiff**](https://github.com/mattpolzin/OpenAPIDiff) is a library and a CLI that implements semantic diffing; that is, rather than just comparing two OpenAPI documents line-by-line for textual differences, it parses the documents and describes the differences in the two OpenAPI ASTs.
459
461
460
462
## Notes
461
-
This library does *not*currently support file reading at all muchless following `$ref`s to other files and loading them in. You must read OpenAPI documentation into `Data` or `String` (depending on the decoder you want to use) and all references must be internal to the same file to be resolved.
463
+
This library does *not*handle reading files from disk or otherwise. You must read OpenAPI documentation into `Data` or `String` (depending on the decoder you want to use) and then decode using OpenAPIKit's `Decodable` conformances.
462
464
463
465
This library *is* opinionated about a few defaults when you use the Swift types, however encoding and decoding stays true to the spec. Some key things to note:
464
466
@@ -475,7 +477,7 @@ Contributions to OpenAPIKit are welcome and appreciated! The project is mostly m
475
477
476
478
Please see the [Contribution Guidelines](./CONTRIBUTING.md) for a few brief notes on contributing the the project.
477
479
478
-
## Security
480
+
## Project Security
479
481
The OpenAPIKit project takes code security seriously. As part of the Swift Server Workground incubation program, this project follows a shared set of standards around receiving, reporting, and reacting to security vulnerabilies.
480
482
481
483
Please see [Security](./SECURITY.md) for information on how to report vulnerabilities to the OpenAPIKit project and what to expect after you do.
0 commit comments