Consume JSONSchema to initialize dry-schema?

Is there any way to get started with dry-schema by importing a JSONSchema document?

I’m building features in Ruby on top of a Go backend. The API publishes a Swagger (OpenAPI) document. We’ve had success using Kubb to generate decoders for the TypeScript parts of the app, but Kubb doesn’t go beyond the JavaScript ecosystem.

I am aware of openapi-generator, which has basic Ruby support but doesn’t use any of dry-rb.

I’m new to dry-rb but it looks very well engineered.

Not exactly what you are looking for there’s dry-types and dry-struct output on this tool https://app.quicktype.io/.
I created GitHub - elcuervo/dry-types-json-schema which converts dry-types to a close openapi spec. I guess that the opposite could also be added to the gem itself.

1 Like