diff --git a/README.md b/README.md index cba483a..6ffe3e1 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ Note that Playground support for importing non-system Frameworks is still a bit - `data` - [x] Encoding/Decoding - [x] Arbitrary - - [ ] OpenAPI + - [x] OpenAPI - `included` - [x] Encoding/Decoding - [x] Arbitrary diff --git a/Sources/JSONAPIOpenAPI/JSONAPITypes+OpenAPI.swift b/Sources/JSONAPIOpenAPI/JSONAPITypes+OpenAPI.swift index 11934be..619e296 100644 --- a/Sources/JSONAPIOpenAPI/JSONAPITypes+OpenAPI.swift +++ b/Sources/JSONAPIOpenAPI/JSONAPITypes+OpenAPI.swift @@ -91,7 +91,9 @@ extension RelationshipType { } extension ToOneRelationship: OpenAPINodeType { - // TODO: const for json `type` + // NOTE: const for json `type` not supported by OpenAPI 3.0 + // Will use "enum" with one possible value for now. + // TODO: metadata & links static public func openAPINode() throws -> JSONNode { let nullable = Identifiable.self is _Optional.Type @@ -104,7 +106,9 @@ extension ToOneRelationship: OpenAPINodeType { } extension ToManyRelationship: OpenAPINodeType { - // TODO: const for json `type` + // NOTE: const for json `type` not supported by OpenAPI 3.0 + // Will use "enum" with one possible value for now. + // TODO: metadata & links static public func openAPINode() throws -> JSONNode { return .object(.init(format: .generic,