Skip to main content

schema_to_yaml_template

Function schema_to_yaml_template 

Source
pub fn schema_to_yaml_template(schema: &Value, indent_spaces: usize) -> String
Expand description

Render the properties of schema as a YAML block, indented by indent_spaces columns. Returns a string that always ends with \n.

Tagged-enum fields get their first variant inlined and the remaining variants emitted as commented-out “alternative” blocks the user can uncomment to switch. Use schema_to_yaml_template_with_choices to override which variant is inlined.