Skip to content

Commit

Permalink
Merge pull request #223 from mattpolzin/readme-tweaks
Browse files Browse the repository at this point in the history
Add brief preliminary notes about using v3.0.0 of OpenAPIKit
  • Loading branch information
mattpolzin authored May 28, 2021
2 parents e547a1d + bad693b commit 76edc1d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,31 @@ A library containing Swift types that encode to- and decode from [OpenAPI](https

## Usage

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

#### 2.x to 3.0.0
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).

In package manifests, dependencies will be one of:
```
// v3.0 of spec:
dependencies: [.product(name: "OpenAPIKit30", package: "OpenAPIKit")]
// v3.1 of spec:
dependencies: [.product(name: "OpenAPIKit", package: "OpenAPIKit")]
```

Your imports need to be specific as well:
```swift
// v3.0 of spec:
import OpenAPIKit30

// v3.1 of spec:
import OpenAPIKit
```

### Decoding OpenAPI Documents

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:
Expand Down

0 comments on commit 76edc1d

Please sign in to comment.