Updated example in playground/documentation after realizing I was not using a variable I had created.

This commit is contained in:
Mathew Polzin
2019-07-28 13:10:42 -07:00
parent 4d3597ef0e
commit c4f96c0376
2 changed files with 6 additions and 6 deletions
@@ -114,7 +114,7 @@ func articleDocument(includeAuthor: Bool) -> Either<SingleArticleDocument, Singl
let includes: Includes<SingleArticleDocumentWithIncludes.Include> = .init(values: [.init(author)])
return .init(document.including(.init(values: [.init(author)])))
return .init(document.including(includes))
}
}
+5 -5
View File
@@ -750,7 +750,7 @@ func articleDocument(includeAuthor: Bool) -> Either<SingleArticleDocument, Singl
let includes: Includes<SingleArticleDocumentWithIncludes.Include> = .init(values: [.init(author)])
return .init(document.including(.init(values: [.init(author)])))
return .init(document.including(includes))
}
}
@@ -813,9 +813,9 @@ print(response.author)
```
# JSONAPI+Testing
The `JSONAPI` framework is packaged with a test library to help you test your `JSONAPI` integration.
The `JSONAPI` framework is packaged with a test library to help you test your `JSONAPI` integration.
The test library is called `JSONAPITesting`. It provides literal expressibility for `Attribute`, `ToOneRelationship`, and `Id` in many situations so that you can easily write test `ResourceObject` values into your unit tests. It also provides a `check()` function for each `ResourceObject` type that can be used to catch problems with your `JSONAPI` structures that are not caught by Swift's type system.
The test library is called `JSONAPITesting`. It provides literal expressibility for `Attribute`, `ToOneRelationship`, and `Id` in many situations so that you can easily write test `ResourceObject` values into your unit tests. It also provides a `check()` function for each `ResourceObject` type that can be used to catch problems with your `JSONAPI` structures that are not caught by Swift's type system.
You can see the `JSONAPITesting` in action in the Playground included with the `JSONAPI` repository.
@@ -823,8 +823,8 @@ You can see the `JSONAPITesting` in action in the Playground included with the `
This library has moved into its own Package. See https://github.com/mattpolzin/JSONAPI-Arbitrary for more information.
# JSONAPI+OpenAPI
The `JSONAPI+OpenAPI` library generates OpenAPI compliant JSON Schema for models built with the `JSONAPI` library. If your Swift code is your preferred source of truth for API information, this is an easy way to document the response schemas of your API.
The `JSONAPI+OpenAPI` library generates OpenAPI compliant JSON Schema for models built with the `JSONAPI` library. If your Swift code is your preferred source of truth for API information, this is an easy way to document the response schemas of your API.
`JSONAPI+OpenAPI` also has experimental support for generating `JSONAPI` Swift code from Open API documentation (this currently lives on the `feature/gen-swift` branch).
`JSONAPI+OpenAPI` also has experimental support for generating `JSONAPI` Swift code from Open API documentation (this currently lives on the `feature/gen-swift` branch).
See https://github.com/mattpolzin/JSONAPI-OpenAPI for more information.