You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When generating code with scala-akka-http-server, a query parameter with type=string and format=date-time is mapped to a Scala String instead of OffsetDateTime.
openapi-generator version
7.10.0
OpenAPI declaration file content or url
Example query parameter definition:
- name: createdFromin: querydescription: "Only return `Files` that were created after this date and time, expressed in ISO 8601 format."required: falseschema:
type: stringformat: date-time
Generation Details
openapi-generator generate -g scala-akka-http-server -i https://api.swaggerhub.com/apis/pagero-api/file-api/1.1.0/swagger.yaml\?resolved\=true -o out
Steps to reproduce
The generated file out/src/main/scala/org/openapitools/server/api/FileApi.scala contains the following:
In the code above, the query parameters createdFrom and createdTo should have the type OffsetDateTime.
Related issues/PRs
None found
Suggest a fix
The reason seems to be that in ScalaAkkaHttpServerCodegen.java->fromParameter (Line 294), param.dataType is always set to String for all non-primitive parameter types.
I'm new to openapi-generator so I can't really tell whether this is "by design". Perhaps since scala-akka-http-server is still in Beta, support for non-primitive data types in query parameters may not yet have been added?
Perhaps @Bouillie or @chameleon82 who seem to have been involved with creating this generator could shed some light on this? I'd be happy to contribute but would need some pointers on where to start in implementing this.
I'm also wondering what the current status of the scala-akka-http-server generator is. It seems to have been in beta for a while now.
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
When generating code with
scala-akka-http-server
, a query parameter withtype=string
andformat=date-time
is mapped to a ScalaString
instead ofOffsetDateTime
.openapi-generator version
7.10.0
OpenAPI declaration file content or url
Example query parameter definition:
Generation Details
Steps to reproduce
The generated file
out/src/main/scala/org/openapitools/server/api/FileApi.scala
contains the following:In the code above, the query parameters
createdFrom
andcreatedTo
should have the typeOffsetDateTime
.Related issues/PRs
None found
Suggest a fix
The reason seems to be that in
ScalaAkkaHttpServerCodegen.java
->fromParameter
(Line 294),param.dataType
is always set toString
for all non-primitive parameter types.I'm new to openapi-generator so I can't really tell whether this is "by design". Perhaps since
scala-akka-http-server
is still in Beta, support for non-primitive data types in query parameters may not yet have been added?Perhaps @Bouillie or @chameleon82 who seem to have been involved with creating this generator could shed some light on this? I'd be happy to contribute but would need some pointers on where to start in implementing this.
I'm also wondering what the current status of the
scala-akka-http-server
generator is. It seems to have been in beta for a while now.The text was updated successfully, but these errors were encountered: