From 5da4a963d440a76300faa0095e3ddf6e2ad48410 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Mon, 21 Jan 2019 22:50:19 -0800 Subject: [PATCH] Update README and code documentation slightly --- README.md | 2 +- Sources/JSONAPIOpenAPI/JSONAPITypes+OpenAPI.swift | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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,