mirror of
https://github.com/apple/pkl.git
synced 2026-01-12 06:40:42 +01:00
Use pkl to validate existing config files #172
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @derphilipp on GitHub (Jun 25, 2024).
Is it possible to achive:
This way golang programs could harness the power of pkl without modifying the user expirience / config files of existing tools
@holzensp commented on GitHub (Jun 25, 2024):
[aside: I'd prefer questions like this under Discussions]
Yes. You don't even need to write a Go program for the validation. That said, I think our editing experience is better than most JSON experiences. I guess "existing tools" might be a deal-breaker. Anyway, yes, you can always add the following to any template;
Now, if you invoke Pkl with a value for external property
JsonPathto point to your.jsonfile, you can consumeoutput.valueas an instance of the module it's defined in.@derphilipp commented on GitHub (Jun 25, 2024):
Thank you very much and you are absolutely right, this should be under 'Discussion'!