Closed DwieDave closed 2 months ago
Should be doable. Thanks for the report. I'm out of country for a week and not sure I'll get to it quickly. If you don't want to wait and feel like investigating on your own, the solution will be probably in the schema-openapi package.
Hi thanks for the reply!
I've created a PR in the schema-openapi
which now returns a current Date as default randomExample
for a Date Schema.
Sadly this doesn't fix the issue mentioned above for me. I've updated to the latest version that includes the schema-openapi
version with the fix but the random value is still just "string".
Do you have another hint where this issue could be located so I can take a look?
The example is generated by the OpenAPI itself and once I added the format
field it started recommending a string with a date inside. Please try with the latest version.
Ah, I see. That definetly fixes the issue! Thank you!
Hey, I've noticed that when using a
Schema.Date
in a struct the example in Swagger doesn't produce usable date-strings: instead they produce "string".Is it possible to get it to work like with
S.UUID
?Reproduction
This is what Swagger shows with the given Schema set as requestBody:
Which of course leads to an error when trying to execute in Swagger:
Question
Is it possible to get the current date as an iso string for the swagger documentation by setting some annotations in Schema for example? Or is this not possible at the moment?
Packages: "@effect/platform": "^0.48.27", "@effect/platform-node": "^0.45.29", "effect": "^2.4.18", "effect-http": "^0.60.7", "effect-http-node": "^0.8.8",