In several places in the OpenAPI the examples are broken.
The examples are shown as the output of the method .toString instead of proper JSON as is expected by the API
I suspect the problem comes from for the marco Schema.derived and the case class Annotation[E](description: String, example: E, validator: Validator[E] = Validator.pass[E])
This E is of type Any and without requiring anything.
I also don't see any value for Schema[Annotation]
So where is the Schema[Annotation[_]] ?
I bet the macro Schema.derived is calling the method Object#toString in that case.
IMO my opinion the macro should fill in that case.
We could require E to have json encoder and adding some glue to make it work on a more generic case
Please provide the exception or error you saw
Instead of
we want
Please provide the environment you discovered this bug in
Is this a regression?
No
Description
In several places in the OpenAPI the examples are broken. The examples are shown as the output of the method
.toString
instead of proper JSON as is expected by the APITo fix these people use a hammer like
@encodedExample(JsonEncoder[...
See https://github.com/hyperledger/identus-cloud-agent/pull/1130I suspect the problem comes from for the marco
Schema.derived
and thecase class Annotation[E](description: String, example: E, validator: Validator[E] = Validator.pass[E])
This
E
is of typeAny
and without requiring anything. I also don't see any value forSchema[Annotation]
So where is the Schema[Annotation[_]] ? I bet the macroSchema.derived
is calling the methodObject#toString
in that case. IMO my opinion the macro should fill in that case.We could require
E
to have json encoder and adding some glue to make it work on a more generic casePlease provide the exception or error you saw
Instead of
we want
Please provide the environment you discovered this bug in
No response
Anything else?
No response