ocaml-ppx / ppx_deriving

Type-driven code generation for OCaml
MIT License
466 stars 89 forks source link

show: handle [@printer] in polymorphic variants #267

Open ghuysmans opened 1 year ago

brycenichols commented 11 months ago

Code generated by openapi-generator-cli for ocaml uses custom printers for polymorphic variant branches as a way of supporting jsonschema enum types in generated client library code. I would have expected (and the openapi-generator-cli authors did, too) that the annotations would work the same way as for regular variants, but instead, the custom printers are silently ignored. The fix in this PR would be very helpful.