Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Generate json.schema files from case classes #60

Open
Daenyth opened this issue May 6, 2020 · 2 comments
Open

Feature request: Generate json.schema files from case classes #60

Daenyth opened this issue May 6, 2020 · 2 comments

Comments

@Daenyth
Copy link

Daenyth commented May 6, 2020

I'd love to be able to generate json schema files

Ideally, it would support:

  • sealed trait families map to oneOf
    • case object would be values, like in sealed trait T; case object A extends T; case object B extends T would be "type A, values oneOf A, B"
  • AnyVal wrapper classes map to a named type, use sites would use $ref
  • Schemas generated could reference each other, mirroring the scala file layouts/imports
@davegurnell
Copy link
Owner

Sorry it's taken me so long to look at this. I guess the big question is: can you go from an ADT like Type or TsType all the way to a JSON Schema definition? If so, I'd be happy to pair with you (or anyone) to implement it.

@davegurnell
Copy link
Owner

FWIW - I'm guessing that libraries like Tapir have support for this kind of thing already, but I think it's a good fit for Bridges anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants