Expand description
OpenAPI 3.0 JSON → forge_ir::Ir.
Stage 3 supports a deliberately narrow subset of OpenAPI 3.0.x. See
docs/parser-coverage.md for the precise list. Anything outside the
subset produces an error-severity diagnostic with a JSON-pointer
location — never silent best-effort output.
§Public surface
let json = std::fs::read_to_string("openapi.json").unwrap();
match forge_parser::parse_str(&json) {
Ok(out) => {
for d in &out.diagnostics { eprintln!("{}: {}", d.code, d.message); }
if let Some(ir) = out.spec { println!("{} operations", ir.operations.len()); }
}
Err(e) => eprintln!("fatal: {e}"),
}Re-exports§
pub use external::FileResolver;pub use external::NoExternalResolver;pub use external::Resolver;pub use external::ResolverError;
Modules§
- external
- External
$refresolution.
Structs§
Enums§
Functions§
- parse_
path - Parse a spec from a filesystem path. External
$refs are resolved relative to the spec file’s parent directory; paths that escape that root are rejected withparser/E-EXTERNAL-REF. - parse_
str - Parse an OpenAPI 3.0 JSON document.
- parse_
str_ with_ file - Parse with a
filelabel that gets attached to everySpecLocation.