Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump OpenAPIKit to 3.0.0-beta.1 #215

Merged
merged 3 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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