Skip to content

Commit

Permalink
Merge branch 'release/4_0' into load-external-references-v4-take2
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Apr 21, 2024
2 parents f11d2cd + 698c29b commit 50f85fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ let encodedOpenAPIDoc = try encoder.encode(openAPIDoc)
### Validating OpenAPI Documents
Thanks to Swift's type system, the vast majority of the OpenAPI Specification is represented by the types of OpenAPIKit -- you cannot create bad OpenAPI docuements in the first place and decoding a document will fail with generally useful errors.

That being said, there are a small number of additional checks that you can perform to really put any concerns to bed.
That being said, there are a small number of additional checks that you can perform to really put any concerns to rest.

```swift
let openAPIDoc: OpenAPI.Document = ...
Expand Down
2 changes: 2 additions & 0 deletions Sources/OpenAPIKitCore/AnyCodable/AnyCodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ extension AnyCodable: Equatable {
return lhs == rhs
case let (lhs as String, rhs as String):
return lhs == rhs
case let (lhs as URL, rhs as URL):
return lhs == rhs
case let (lhs as [String: String], rhs as [String: String]):
return lhs == rhs
case let (lhs as [String: Int], rhs as [String: Int]):
Expand Down
1 change: 1 addition & 0 deletions Tests/AnyCodableTests/AnyCodableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AnyCodableTests: XCTestCase {
XCTAssertEqual(AnyCodable(Float(2)), AnyCodable(Float(2)))
XCTAssertEqual(AnyCodable(Double(2)), AnyCodable(Double(2)))
XCTAssertEqual(AnyCodable("hi"), AnyCodable("hi"))
XCTAssertEqual(AnyCodable(URL(string: "file://./params/name.json")), AnyCodable(URL(string: "file://./params/name.json")))
XCTAssertEqual(AnyCodable(["hi": AnyCodable(2)]), AnyCodable(["hi": AnyCodable(2)]))
XCTAssertEqual(AnyCodable([AnyCodable("hi"), AnyCodable("there")]), AnyCodable([AnyCodable("hi"), AnyCodable("there")]))
XCTAssertEqual(AnyCodable(["hi":1]), AnyCodable(["hi":1]))
Expand Down

0 comments on commit 50f85fe

Please sign in to comment.