diff --git a/Sources/JSONAPIOpenAPI/JSONAPIOpenAPITypes.swift b/Sources/JSONAPIOpenAPI/JSONAPIOpenAPITypes.swift index 33b7c81..ecd76db 100644 --- a/Sources/JSONAPIOpenAPI/JSONAPIOpenAPITypes.swift +++ b/Sources/JSONAPIOpenAPI/JSONAPIOpenAPITypes.swift @@ -36,6 +36,7 @@ extension TransformedAttribute: OpenAPINodeType where RawValue: OpenAPINodeType extension ToOneRelationship: OpenAPINodeType { // TODO: const for json `type` + // TODO: metadata & links static public var openAPINode: OpenAPI.JSONNode { let nullable = Identifiable.self is _Optional.Type return .object(.init(format: .generic, @@ -58,6 +59,7 @@ extension ToOneRelationship: OpenAPINodeType { extension ToManyRelationship: OpenAPINodeType { // TODO: const for json `type` + // TODO: metadata & links static public var openAPINode: OpenAPI.JSONNode { return .object(.init(format: .generic, required: true), diff --git a/Sources/JSONAPIOpenAPI/OpenAPISchemaNode.swift b/Sources/JSONAPIOpenAPI/OpenAPISchemaNode.swift deleted file mode 100644 index 70784f4..0000000 --- a/Sources/JSONAPIOpenAPI/OpenAPISchemaNode.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// OpenAPISchemaNode.swift -// JSONAPIOpenAPI -// -// Created by Mathew Polzin on 1/13/19. -// - -extension OpenAPI { - /// A single node in the schema. This is the - struct SchemaNode { - - /// Indicates where the object is required - /// or optional. - let required: Bool - - /// This can be an empty Dictionary if there - /// are no properties on this node. - let properties: [String: SchemaNode] - - - - let title: String? - } - - enum SchemaNodeType { - case `enum` - } -} diff --git a/Sources/JSONAPIOpenAPI/SwiftPrimitiveTypes.swift b/Sources/JSONAPIOpenAPI/SwiftPrimitiveTypes.swift index 236ef95..c217eb4 100644 --- a/Sources/JSONAPIOpenAPI/SwiftPrimitiveTypes.swift +++ b/Sources/JSONAPIOpenAPI/SwiftPrimitiveTypes.swift @@ -24,6 +24,9 @@ RFC3339 date-time: A hint to UIs to obscure input: .string(.password) +Any object: +.object(.generic) + **/ extension Optional: OpenAPINodeType where Wrapped: OpenAPINodeType {