Skip to content

Commit

Permalink
Fix header parameter generation for Sunday clients
Browse files Browse the repository at this point in the history
  • Loading branch information
kdubb committed Dec 22, 2024
1 parent c4fd9dc commit d7ef2a2
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ class KotlinSundayGenerator(

uriParameters = mutableListOf()
queryParameters = mutableListOf()
headerParameters = mutableListOf()
originalReturnType = null
requestBodyParameter = null
requestBodyType = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ class SwiftSundayGenerator(

uriParameters = mutableListOf()
queryParameters = mutableListOf()
headerParameters = mutableListOf()
originalReturnType = null
requestBodyParameter = null
requestBodyType = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ class TypeScriptSundayGenerator(

uriParameters = mutableListOf()
queryParameters = mutableListOf()
headerParameters = mutableListOf()
originalReturnType = null
requestBodyParameter = null
requestBodyType = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class RequestHeaderParamsTest {
import io.test.Test
import javax.ws.rs.Consumes
import javax.ws.rs.DELETE
import javax.ws.rs.DefaultValue
import javax.ws.rs.GET
import javax.ws.rs.HeaderParam
Expand All @@ -78,6 +79,10 @@ class RequestHeaderParamsTest {
@HeaderParam(value = "str-req") strReq: String,
@HeaderParam(value = "int") @DefaultValue(value = "5") int: Int,
): Response
@DELETE
@Path(value = "/tests")
public fun deleteTest(): Response
}
""".trimIndent(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class RequestHeaderParamsTest {
import io.test.Test
import kotlin.Int
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
public class API(
Expand All @@ -84,6 +85,12 @@ class RequestHeaderParamsTest {
"int" to int
)
)
public suspend fun deleteTest(): Unit = this.requestFactory
.result(
method = Method.Delete,
pathTemplate = "/tests"
)
}
""".trimIndent(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ class RequestHeaderParamsTest {
)
}
public func deleteTest() async throws {
return try await self.requestFactory.result(
method: .delete,
pathTemplate: "/tests",
pathParameters: nil,
queryParameters: nil,
body: Empty.none,
contentTypes: nil,
acceptTypes: self.defaultAcceptTypes,
headers: nil
)
}
}
""".trimIndent(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ class RequestHeaderParamsTest {
);
}
deleteTest(): Observable<void> {
return this.requestFactory.result(
{
method: 'DELETE',
pathTemplate: '/tests'
}
);
}
}
const fetchTestReturnType: AnyType = [Test];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ types:
200:
body:
type: Test
delete: # ensure headers are not included in following methods
displayName: deleteTest
responses:
204:

0 comments on commit d7ef2a2

Please sign in to comment.