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

Support a toJSON for each type that converts Kubernetes objects into weakly typed JSON #156

Open
s-zeng opened this issue Nov 11, 2020 · 2 comments

Comments

@s-zeng
Copy link
Contributor

s-zeng commented Nov 11, 2020

This was something that was brought up a while back:
https://discourse.dhall-lang.org/t/expense-proposal-pure-dhall-function-to-render-yaml/92/10?u=s-zeng

But I did not find a matching ticket for it, so I'm creating one now with this ticket.

We should auto generate a toJSON function for each kubernetes type that transforms them into a weakly typed Prelude.JSON.object.

Use case:
We can directly render yaml as text from dhall without needing dhall-to-yaml. In particular, I would find this very useful in making helm charts (our org requires making helm charts for making packages for external consumption) where it would become much more ergonomic to insert {{go template}} clauses for non-string purposes

@Gabriella439
Copy link
Contributor

I think this is the ticket I'd suggest for this purpose:

dhall-lang/dhall-lang#336

@kosta
Copy link

kosta commented Jan 12, 2023

Isn’t JSON.object toMap … enough? If so, maybe extend the Readme examples for “list of kubernetes objects”. Because I don’t see how to put kubernetes objects and crds in the same list otherwise.

(But on the other hand, I only have multiple hours of dhall experience)

Edit: Ok, so JSON.object toMap kubernetesObject wont work as kubernetesObject very most likely is not an homogenous record. I see.

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

3 participants