Open challe opened 3 days ago
That is exactly what I was going to suggest as a "quick workaround".
However, YAML support in the generator would be good.
And then support for direct generation from https://www.asyncapi.com/docs/reference/specification/v3.0.0.
As with OpenAPI, we'd want to do a walk through the whole doc to gather the inline and referenced schema, rather than making you do it.
Although this is not directly relevant to your case (as we would already have loaded and parsed the document before getting to the schema!) I've opened #499 to provide YAML support.
I will leave this open to track supporting AsyncAPI documents directly.
We're moving from specifying our schemas in individual JSON files to storing multiple schemas inside a yaml file following the AsyncAPI specification.
But I would still like to use Corvus.JsonSchema to generate the models (since nothing comes even close to being as awesome 😄).
Is there a good way of doing this? My initial idea was to parse the yaml file to extract a schema, convert it to JSON, and then pass it to Corvus.JsonSchema.
Any other ideas?
Of course it would be awesome to be able to just pass an asyncapi spec file as input and it would generate the models for me but I guess that's not built in as of now.
Edit: I managed to hack something together by using
yq
: