get_schema_file

Function get_schema_file 

Source
pub fn get_schema_file(path: &str) -> Option<&'static [u8]>
Expand description

Returns the contents of an embedded schema file identified by its path relative to the schemas root.

The path is relative to the embedded schemas directory, for example "spec-driven/schema.yaml".

§Returns

Some(&[u8]) with the file contents if a matching embedded schema exists, None otherwise.

§Examples

use ito_templates::get_schema_file;
let bytes = get_schema_file("spec-driven/schema.yaml").expect("schema should exist");
assert!(!bytes.is_empty());