Skip to content

Commit bad693b

Browse files
committed
Add brief preliminary notes about using v3.0.0 of OpenAPIKit
1 parent 4fc072b commit bad693b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,31 @@ A library containing Swift types that encode to- and decode from [OpenAPI](https
3131

3232
## Usage
3333

34+
### Migration
35+
#### 1.x to 2.x
3436
If you are migrating from OpenAPIKit 1.x to OpenAPIKit 2.x, check out the [migration guide](./documentation/v2_migration_guide.md).
3537

38+
#### 2.x to 3.0.0
39+
There is not yet a migration guide for upgrading from OpenAPIKit 2.x to OpenAPIKit 3.0.0. You will need to start being explicit about which of the two new modules you want to use in your project: `OpenAPIKit` (now supports OpenAPI spec v3.1) and/or `OpenAPIKit30` (continues to support OpenAPI spec v3.0 like the previous versions of OpenAPIKit did).
40+
41+
In package manifests, dependencies will be one of:
42+
```
43+
// v3.0 of spec:
44+
dependencies: [.product(name: "OpenAPIKit30", package: "OpenAPIKit")]
45+
46+
// v3.1 of spec:
47+
dependencies: [.product(name: "OpenAPIKit", package: "OpenAPIKit")]
48+
```
49+
50+
Your imports need to be specific as well:
51+
```swift
52+
// v3.0 of spec:
53+
import OpenAPIKit30
54+
55+
// v3.1 of spec:
56+
import OpenAPIKit
57+
```
58+
3659
### Decoding OpenAPI Documents
3760

3861
You can decode a JSON OpenAPI document (i.e. using the `JSONDecoder` from **Foundation** library) or a YAML OpenAPI document (i.e. using the `YAMLDecoder` from the [**Yams**](https://github.com/jpsim/Yams) library) with the following code:

0 commit comments

Comments
 (0)