-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Not sure if it's possible, but it would be nice if we could use custom decoders so that the field names in our case classes weren't tied to the attributes they represent in the json. For example:
case class Cat(a: String, b: Int)
implicit val decoder: Decoder[Cat] = Decoder.forProduct2("the_a", "the_b")(Cat.apply)
println(JsonSchema.deriveFor[Cat].asJson.pretty(Printer.spaces2))
// {
// "type" : "object",
// "required" : [
// "a", <--- should be the_a
// "b" <--- should be the_b
// ],
// "properties" : {
// "a" : {
// "type" : "string"
// },
// "b" : {
// "type" : "integer",
// "format" : "int32"
// }
// }
// }Metadata
Metadata
Assignees
Labels
No labels