Skip to main content

pecto_core/
output.rs

1use crate::model::ProjectSpec;
2
3/// Serialize a ProjectSpec to YAML.
4pub fn to_yaml(spec: &ProjectSpec) -> Result<String, serde_yaml::Error> {
5    serde_yaml::to_string(spec)
6}
7
8/// Serialize a ProjectSpec to JSON.
9pub fn to_json(spec: &ProjectSpec) -> Result<String, serde_json::Error> {
10    serde_json::to_string_pretty(spec)
11}