oaspec/openapi/parser
Values
pub fn parse_error_to_string(
error: diagnostic.Diagnostic,
) -> String
Parse a schema reference (either $ref or inline schema). Convert a parse error to a human-readable string.
pub fn parse_file(
path: String,
) -> Result(
spec.OpenApiSpec(spec.Unresolved),
diagnostic.Diagnostic,
)
Parse an OpenAPI spec from a file path.
Supports both YAML (.yaml, .yml) and JSON (.json) files.
After parsing, resolves relative-file $ref values in
components.schemas by loading the referenced files from disk and
merging their schemas. Nested or parameter/response external refs are
left to downstream validation.
pub fn parse_string(
content: String,
) -> Result(
spec.OpenApiSpec(spec.Unresolved),
diagnostic.Diagnostic,
)
Parse an OpenAPI spec from a YAML/JSON string.