oaspec/openapi/parser
Values
pub fn parse_error_to_string(
error: diagnostic.Diagnostic,
) -> String
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.
pub fn parse_schema_object(
node: yay.Node,
path: String,
) -> Result(schema.SchemaObject, diagnostic.Diagnostic)
Parse a schema object.
pub fn parse_schema_ref(
node: yay.Node,
path: String,
) -> Result(schema.SchemaRef, diagnostic.Diagnostic)
Parse a schema reference (either $ref or inline schema).
pub fn parse_string(
content: String,
) -> Result(
spec.OpenApiSpec(spec.Unresolved),
diagnostic.Diagnostic,
)
Parse an OpenAPI spec from a YAML/JSON string.