bridges
bridges copied to clipboard
Feature request: Generate json.schema files from case classes
I'd love to be able to generate json schema files
Ideally, it would support:
-
sealed
trait families map tooneOf
-
case object
would be values, like insealed trait T; case object A extends T; case object B extends T
would be "typeA
, values oneOfA
,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
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.
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.