Skip to content

Commit

Permalink
2.17.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dankinsoid committed Jun 10, 2023
1 parent 807e3da commit be33d8d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import PackageDescription
let package = Package(
name: "SomeProject",
dependencies: [
.package(url: "https://github.com/dankinsoid/SwiftOpenAPI.git", from: "2.17.4")
.package(url: "https://github.com/dankinsoid/SwiftOpenAPI.git", from: "2.17.5")
],
targets: [
.target(name: "SomeProject", dependencies: ["SwiftOpenAPI"])
Expand Down
29 changes: 28 additions & 1 deletion Sources/SwiftOpenAPI/OpenAPIType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,34 @@ extension Optional: OpenAPIDescriptable where Wrapped: OpenAPIDescriptable {

extension Optional: OpenAPIType where Wrapped: OpenAPIType {

public static var openAPISchema: SchemaObject { Wrapped.openAPISchema }
public static var openAPISchema: SchemaObject { Wrapped.openAPISchema.with(\.nullable, true) }
}

extension Dictionary: OpenAPIDescriptable where Key == String, Value: OpenAPIType {}

extension Dictionary: OpenAPIType where Key == String, Value: OpenAPIType {

public static var openAPISchema: SchemaObject {
.dictionary(of: .value(Value.openAPISchema))
}
}

extension Array: OpenAPIDescriptable where Element: OpenAPIDescriptable {}

extension Array: OpenAPIType where Element: OpenAPIType {

public static var openAPISchema: SchemaObject {
.array(of: .value(Element.openAPISchema))
}
}

extension Set: OpenAPIDescriptable where Element: OpenAPIDescriptable {}

extension Set: OpenAPIType where Element: OpenAPIType {

public static var openAPISchema: SchemaObject {
.array(of: .value(Element.openAPISchema), uniqueItems: true)
}
}

private extension FixedWidthInteger {
Expand Down
2 changes: 1 addition & 1 deletion SwiftOpenAPI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SwiftOpenAPI'
s.version = '2.17.4'
s.version = '2.17.5'
s.summary = 'A short description of SwiftOpenAPI.'
s.description = <<-DESC
TODO: Add long description of the pod here.
Expand Down

0 comments on commit be33d8d

Please sign in to comment.