From ce8e9be362b0c7c86c9fdb436518495bd519af75 Mon Sep 17 00:00:00 2001 From: Tibor Bodecs Date: Mon, 9 Feb 2026 09:42:54 +0100 Subject: [PATCH] fix non-required schema references --- README.md | 6 +++--- .../Schema/Abstraction/SchemaRepresentable.swift | 2 +- Tests/FeatherOpenAPITests/TestObjects.swift | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c2a2004..4cad7b7 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ The FeatherOpenAPI library makes it easy to define OpenAPI specifications using Swift in a type-safe way. [ - ![Release: 1.0.0-beta.3](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E3-F05138) + ![Release: 1.0.0-beta.4](https://img.shields.io/badge/Release-1%2E0%2E0--beta%2E4-F05138) ]( - https://github.com/feather-framework/feather-openapi/releases/tag/1.0.0-beta.3 + https://github.com/feather-framework/feather-openapi/releases/tag/1.0.0-beta.4 ) ## Features @@ -34,7 +34,7 @@ The FeatherOpenAPI library makes it easy to define OpenAPI specifications using Use Swift Package Manager; add the dependency to your `Package.swift` file: ```swift -.package(url: "https://github.com/feather-framework/feather-openapi", exact: "1.0.0-beta.3"), +.package(url: "https://github.com/feather-framework/feather-openapi", exact: "1.0.0-beta.4"), ``` Then add `FeatherOpenAPI` to your target dependencies: diff --git a/Sources/FeatherOpenAPI/Schema/Abstraction/SchemaRepresentable.swift b/Sources/FeatherOpenAPI/Schema/Abstraction/SchemaRepresentable.swift index e93e589..7af88f9 100644 --- a/Sources/FeatherOpenAPI/Schema/Abstraction/SchemaRepresentable.swift +++ b/Sources/FeatherOpenAPI/Schema/Abstraction/SchemaRepresentable.swift @@ -30,7 +30,7 @@ extension SchemaRepresentable { public func reference( required: Bool = true ) -> SchemaReference { - .init(self) + .init(self, required: required) } /// Default deprecated flag is `nil`. diff --git a/Tests/FeatherOpenAPITests/TestObjects.swift b/Tests/FeatherOpenAPITests/TestObjects.swift index 79ca84d..84fdc3a 100644 --- a/Tests/FeatherOpenAPITests/TestObjects.swift +++ b/Tests/FeatherOpenAPITests/TestObjects.swift @@ -73,8 +73,8 @@ struct TodoDetailObject: ObjectSchemaRepresentable { [ "id": TodoIDField().reference(), "title": TodoTitleField(), - "isComplete": TodoIsCompleteField(), - // "unsafe": UnsafeSchemaReference("asdf"), + "isComplete": TodoIsCompleteField().reference(required: false), + // "unsafe": UnsafeSchemaReference("asdf"), ] }