fn read_file(docs: &mut IndexMap<Utf8PathBuf, OpenAPI>, file_path: impl AsRef<Utf8Path>) -> Result<()> {
        let file_path = file_path.as_ref();
        if !docs.contains_key(file_path) {
            let doc = openapi::parse(&file_path)?;
            let ref_files = openapi::get_reference_file_paths(file_path, &doc);
            docs.insert(Utf8PathBuf::from(file_path), doc);
            for ref_file in ref_files {
                let child_path = io::join(&file_path, &ref_file)?;
                Self::read_file(docs, &child_path)?;
            }
        }
        Ok(())
    }
/// Read a file and references too, recursively into the map
Read a file and references too, recursively into the map
Read a file and references too recursively into the map
fn read_file(docs: &mut IndexMap<Utf8PathBuf, OpenAPI>, file_path: impl AsRef<Utf8Path>) -> Result<()> {
        let file_path = file_path.as_ref();
        if !docs.contains_key(file_path) {
            let doc = openapi::parse(&file_path)?;
            let ref_files = openapi::get_reference_file_paths(file_path, &doc);
            docs.insert(Utf8PathBuf::from(file_path), doc);
            for ref_file in ref_files {
                let child_path = io::join(&file_path, &ref_file)?;
                Self::read_file(docs, &child_path)?;
            }
        }
        Ok(())
    }
fn read_file ( docs : & mut IndexMap < Utf8PathBuf , OpenAPI > , file_path : impl AsRef < Utf8Path > ) -> Result < ( ) > { let file_path = file_path . as_ref ( ) ; if ! docs . contains_key ( file_path ) { let doc = openapi :: parse ( & file_path ) ? ; let ref_files = openapi :: get_reference_file_paths ( file_path , & doc ) ; docs . insert ( Utf8PathBuf :: from ( file_path ) , doc ) ; for ref_file in ref_files { let child_path = io :: join ( & file_path , & ref_file ) ? ; Self :: read_file ( docs , & child_path ) ? ; } } Ok ( ( ) ) }
Read a file and references too, recursively into the map
Read a file and references too recursively into the map
docs
&mut IndexMap<Utf8PathBuf, OpenAPI>
file_path
impl AsRef<Utf8Path>