kyaml
KYAML
A Crystal implementation of KYAML (Kubernetes YAML), a less ambiguous YAML subset as specified in KEP-5295. This shard enables Crystal applications to parse and emit KYAML.
What is KYAML?
KYAML is a strict subset of YAML designed to avoid common pitfalls while still prioritizing ease of use::
- Not whitespace-sensitive: Uses flow-style
{}and[]instead of block-style indentation. Never get lost in indentation hell again. - Still allows comments: Unlike JSON, but like YAML. Because it is YAML.
- Allows trailing commas: Easier editing and cleaner diffs
- Unambiguous strings: Always double-quotes value strings to avoid "Norway bug" (
NO→false) - Unquoted keys: Unless ambiguous (e.g.,
no,true,null)
---
{
apiVersion: "v1",
kind: "Service",
metadata: {
name: "my-service",
labels: {
app: "myapp",
},
},
spec: {
ports: [{
port: 80,
targetPort: 9376,
}],
},
}
Installation
Add the dependency to your shard.yml:
dependencies:
kyaml:
github: lowkeyliesmyth/kyaml
Run shards install
Development
# Run tests
task spec
# Run ameba linter
task lint
# Format code
crystal tool format
# Run specific test file
crystal spec spec/any_spec.cr
Contributing
- Fork it (https://github.com/lowkeyliesmyth/kyaml/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
License
MIT License - see LICENSE for details.
References
Repository
kyaml
Owner
Statistic
- 0
- 0
- 0
- 0
- 1
- 5 days ago
- March 19, 2026
License
MIT License
Links
Synced at
Thu, 07 May 2026 03:04:37 GMT
Languages