Skip to main content

Crate roas_file_fetcher

Crate roas_file_fetcher 

Source
Expand description

Filesystem ResourceFetcher for the roas OpenAPI loader.

FileFetcher is blocking and backed by std::fs::read. Non-file:// URIs are rejected with LoaderError::UnsupportedFetcherUri; I/O failures surface as LoaderError::ReadFile; body parse failures as LoaderError::Parse.

Optional features:

  • async — also expose AsyncFileFetcher for roas::loader::Loader::register_async_fetcher, backed by tokio::fs::read. Requires an active tokio runtime when the returned future is awaited. Off by default; enabling it pulls in tokio with fs + rt features.
  • yaml — parse YAML file bodies in addition to JSON. Selection is by file path extension (.yaml / .yml). Pulls in serde_yaml_ng.

Structs§

FileFetcher
Blocking filesystem fetcher, suitable for Loader::register_fetcher.