Need help with openapi-to-dhall



I’ve tried to generate dhall bindings for traefik using openapi-to-dhall. They provide CRDs here:
I’ve looked at how dhall-kubernetes is generated, but this didn’t help much, there are the following key differences:

  • K8 provides a single swagger file, while there are 9 files for Traefik. This affects top-level files like schemas.dhall - they are overwritten for each file;
  • K8 schema provides more fine-grained types.

As a result I get 9 huge types almost without defaults. Sample default: { apiVersion = "v1alpha1", kind = "TLSOption" }
I’ve been able to “fix” dhall files for, but this required manually splitting 12 type files and 2 default and schema files. This might work for a single release, but will be very hard to support over future releases. Sample test file -
Am I misusing openapi-to-dhall? Or is it just a poor schema that should be improved?
I’ve used the following commands:

for file in `ls ../source/`; do echo $file; yaml-to-dhall --file ../source/$file | dhall-to-json > $file ; done
for file in `ls work`; do openapi-to-dhall --crd work/$file; done


Does combining the split YAML files into a single YAML file resolve the issue?


openapi-to-dhall --crd seems to handle a single CRD at once. I’ve tried to compose all YAMLs, but this resulted in the list at the top level, failing validation for openapi-to-dhall --crd.