knot0-types
Rust types generated from Knot0 JSON Schemas.
Installation
Add this to your Cargo.toml:
[]
= "2.0"
Usage
use ;
use serde_json;
// Deserialize a component from JSON
let component_json = r#"
{
"apiVersion": "knot0.com/v2",
"kind": "Component",
"metadata": {
"name": "my-component"
},
"spec": {
"runtime": "python",
"code": "print('Hello, World!')"
}
}
"#;
let component: Component = from_str?;
Features
json(default): JSON serialization/deserialization supportyaml: YAML serialization/deserialization support
License
MIT