Skip to content

Commit

Permalink
Update existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurcro committed Oct 20, 2024
1 parent b00422f commit 88dd694
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,19 @@ extension TypesFileTranslator {
let responseHasNoContent = typedResponse.response.content.isEmpty
if responseHasNoContent && responseHasNoHeaders && !responseKind.wantsStatusCode {
let staticMemberDesc = VariableDescription(
accessModifier: .internal,
accessModifier: config.access,
isStatic: true,
kind: .var,
left: .identifier(.pattern(enumCaseName)),
type: .member(["Self"]),
right: .closureInvocation(body: [
.expression(.functionCall(calledExpression: .dot(enumCaseName), arguments: [.dot("init")]))
])
getter: [
.expression(
.functionCall(
calledExpression: .dot(enumCaseName),
arguments: [.functionCall(calledExpression: .dot("init"))]
)
)
]
)
staticMemberDecl = .commentable(enumCaseDocComment, .variable(staticMemberDesc))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,14 @@ public enum Operations {
///
/// HTTP response code: `204 noContent`.
case noContent(Operations.createPetWithForm.Output.NoContent)
/// Successfully created pet using a url form
///
/// - Remark: Generated from `#/paths//pets/create/post(createPetWithForm)/responses/204`.
///
/// HTTP response code: `204 noContent`.
public static var noContent: Self {
.noContent(.init())
}
/// The associated value of the enum case if `self` is `.noContent`.
///
/// - Throws: An error if `self` is not `.noContent`.
Expand Down Expand Up @@ -2499,6 +2507,14 @@ public enum Operations {
///
/// HTTP response code: `202 accepted`.
case accepted(Operations.postStats.Output.Accepted)
/// Accepted data.
///
/// - Remark: Generated from `#/paths//pets/stats/post(postStats)/responses/202`.
///
/// HTTP response code: `202 accepted`.
public static var accepted: Self {
.accepted(.init())
}
/// The associated value of the enum case if `self` is `.accepted`.
///
/// - Throws: An error if `self` is not `.accepted`.
Expand Down Expand Up @@ -2541,6 +2557,14 @@ public enum Operations {
///
/// HTTP response code: `204 noContent`.
case noContent(Operations.probe.Output.NoContent)
/// Ack
///
/// - Remark: Generated from `#/paths//probe//post(probe)/responses/204`.
///
/// HTTP response code: `204 noContent`.
public static var noContent: Self {
.noContent(.init())
}
/// The associated value of the enum case if `self` is `.noContent`.
///
/// - Throws: An error if `self` is not `.noContent`.
Expand Down Expand Up @@ -2626,6 +2650,14 @@ public enum Operations {
///
/// HTTP response code: `204 noContent`.
case noContent(Operations.updatePet.Output.NoContent)
/// Successfully updated
///
/// - Remark: Generated from `#/paths//pets/{petId}/patch(updatePet)/responses/204`.
///
/// HTTP response code: `204 noContent`.
public static var noContent: Self {
.noContent(.init())
}
/// The associated value of the enum case if `self` is `.noContent`.
///
/// - Throws: An error if `self` is not `.noContent`.
Expand Down Expand Up @@ -3098,6 +3130,14 @@ public enum Operations {
///
/// HTTP response code: `202 accepted`.
case accepted(Operations.multipartUploadTyped.Output.Accepted)
/// Successfully accepted the data.
///
/// - Remark: Generated from `#/paths//pets/multipart-typed/post(multipartUploadTyped)/responses/202`.
///
/// HTTP response code: `202 accepted`.
public static var accepted: Self {
.accepted(.init())
}
/// The associated value of the enum case if `self` is `.accepted`.
///
/// - Throws: An error if `self` is not `.accepted`.
Expand Down

0 comments on commit 88dd694

Please sign in to comment.