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
I realise that UUIDs are not properly supported by scala-cask yet, but it should generate invalid code.
In a routes file in which there is a reference there is the following for comprehension:-
valresult=for {
uUID <-Parsed
.fromTry(UUIDData.manyFromJsonStringValidated(request.bodyAsString))
.mapError(e =>s"Error parsing json as an array of UUID from >${request.bodyAsString}< : ${e}"
) /* array */
resultTry <-Parsed.eval(service.v1TimesheetsToggleDeferredPost(uUID))
result <-Parsed.fromTry(resultTry)
} yield result
and UUIDData is flagged as not found. manyFromJsonStringValidated seems to be the only method on this class that is called.
It would be really helpful BTW if UUID support was added for type: "string" format: "uuid" objects. Where in the code am I likely to find the right place to intercept this and add support either by adding an import of a given implicit Conversion or explicitly converting the String value to a UUID using UUID.fromString on each use?
openapi-generator version
7.10.0
The text was updated successfully, but these errors were encountered:
I notice that you already include an asUUID method in the ...api.package.scala source that you generate, which correctly uses UUID.fromString to parse the UUID from its string form. Presumably all that is needed to support strings properly would be to recognise the format on a type: "string" object when it is uuid, and use asUUID.
For reasons that are not clear to me, your code assumed java.util.UUID, rather than the Scala equivalent, and upickle does not understand the java.util version, only the Scala version.
Would be a good idea to move to the Scala version? Otherwise it will be necessary to write some upickle code to handle the java version.
I was wrong, upickle does understand java.util.UUID, but cask does not accept it as an endpoint parameter.
So rather than:-
@cask.get("/user/:uniqueid")
defgetUserProfile(uniqueId: UUID) = {
// TODO process the request
}
it should be:-
@cask.get("/user/:uniqueId")
defgetUserProfile(uniqueId: String) = {
valuuid=UUID.fromString(uniqeId)
// TODO processing
}
If you use the UUID as the argument, the compilation of the initialize() (which is a great big macro) fails complaining that "no reader of type java.util.UUID found for parameter uniqueId"
Description
I realise that UUIDs are not properly supported by scala-cask yet, but it should generate invalid code.
In a routes file in which there is a reference there is the following for comprehension:-
and UUIDData is flagged as not found. manyFromJsonStringValidated seems to be the only method on this class that is called.
It would be really helpful BTW if UUID support was added for type: "string" format: "uuid" objects. Where in the code am I likely to find the right place to intercept this and add support either by adding an import of a given implicit Conversion or explicitly converting the String value to a UUID using UUID.fromString on each use?
openapi-generator version
7.10.0
The text was updated successfully, but these errors were encountered: