Skip to content

Commit

Permalink
Bump OpenAPIKit to 3.0.0-beta.1 (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
czechboy0 authored Aug 21, 2023
1 parent 2840e08 commit 3b12834
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3b12834

Please sign in to comment.