diff --git a/Package.swift b/Package.swift index 6761285a..9ec851ee 100644 --- a/Package.swift +++ b/Package.swift @@ -64,7 +64,7 @@ let package = Package( // Read OpenAPI documents .package( url: "https://github.com/mattpolzin/OpenAPIKit.git", - exact: "3.0.0-alpha.9" + exact: "3.0.0-beta.1" ), .package( url: "https://github.com/jpsim/Yams.git", diff --git a/Tests/OpenAPIGeneratorReferenceTests/SnippetBasedReferenceTests.swift b/Tests/OpenAPIGeneratorReferenceTests/SnippetBasedReferenceTests.swift index 70ee1fab..e71526a8 100644 --- a/Tests/OpenAPIGeneratorReferenceTests/SnippetBasedReferenceTests.swift +++ b/Tests/OpenAPIGeneratorReferenceTests/SnippetBasedReferenceTests.swift @@ -1302,45 +1302,39 @@ final class SnippetBasedReferenceTests: XCTestCase { } func testResponseWithExampleWithOnlyValue() throws { - // This test currently throws because the parsing of ExampleObject is too strict: - // https://github.com/mattpolzin/OpenAPIKit/issues/286. - XCTAssertThrowsError( - try self.assertResponsesTranslation( - """ - responses: - MyResponse: - description: Some response - content: + try self.assertResponsesTranslation( + """ + responses: + MyResponse: + description: Some response + content: + application/json: + schema: + type: string + examples: application/json: - schema: - type: string - examples: - application/json: - summary: "a hello response" - """, - """ - public enum Responses { - public struct MyResponse: Sendable, Equatable, Hashable { - public struct Headers: Sendable, Equatable, Hashable { public init() {} } - public var headers: Components.Responses.MyResponse.Headers - @frozen public enum Body: Sendable, Equatable, Hashable { - case json(Swift.String) - } - public var body: Components.Responses.MyResponse.Body - public init( - headers: Components.Responses.MyResponse.Headers = .init(), - body: Components.Responses.MyResponse.Body - ) { - self.headers = headers - self.body = body - } + summary: "a hello response" + """, + """ + public enum Responses { + public struct MyResponse: Sendable, Hashable { + public struct Headers: Sendable, Hashable { public init() {} } + public var headers: Components.Responses.MyResponse.Headers + @frozen public enum Body: Sendable, Hashable { + case json(Swift.String) + } + public var body: Components.Responses.MyResponse.Body + public init( + headers: Components.Responses.MyResponse.Headers = .init(), + body: Components.Responses.MyResponse.Body + ) { + self.headers = headers + self.body = body } } - """ - ) - ) { error in - XCTAssert(error is DecodingError) - } + } + """ + ) } func testRequestWithQueryItems() throws {