pub fn parse(path: impl AsRef<Utf8Path>) -> Result<OpenAPI> {
        let path = path.as_ref();
        let bytes = io::read_file(path)?;
        let api = if path.extension() == Some("yaml") || path.extension() == Some("yml") {
            serde_yaml::from_slice(&bytes)?
        } else {
            serde_json::from_slice(&bytes)?
        };

        Ok(api)
    }
/// Parse an OpenAPI object from a file located at `path`
Parse an OpenAPI object from a file located at `path`
Parse an OpenAPI object from a file located at ` path `
pub fn parse(path: impl AsRef<Utf8Path>) -> Result<OpenAPI> {
        let path = path.as_ref();
        let bytes = io::read_file(path)?;
        let api = if path.extension() == Some("yaml") || path.extension() == Some("yml") {
            serde_yaml::from_slice(&bytes)?
        } else {
            serde_json::from_slice(&bytes)?
        };
        Ok(api)
    }
pub fn parse ( path : impl AsRef < Utf8Path > ) -> Result < OpenAPI > { let path = path . as_ref ( ) ; let bytes = io :: read_file ( path ) ? ; let api = if path . extension ( ) == Some ( " " ) || path . extension ( ) == Some ( " " ) { serde_yaml :: from_slice ( & bytes ) ? } else { serde_json :: from_slice ( & bytes ) ? } ; Ok ( api ) }
Parse an OpenAPI object from a file located at `path`
Parse an OpenAPI object from a file located at ` path `
path
impl AsRef<Utf8Path>