Skip to main content

Crate roas_arazzo

Crate roas_arazzo 

Source
Expand description

OpenAPI Arazzo Specification — parser and validator.

Implements the Arazzo Specification: a document format that describes sequences of API calls (workflows) and their dependencies, independent of the underlying OpenAPI descriptions they orchestrate.

§Modules

§Parsing and validating

use enumset::EnumSet;
use roas_arazzo::v1_0::Description;
use roas_arazzo::validation::Validate;

// Parse an Arazzo description (JSON or YAML).
let doc: Description = serde_json::from_str(r#"{
    "arazzo": "1.0.1",
    "info": { "title": "Example", "version": "1.0.0" },
    "sourceDescriptions": [
        { "name": "petStore", "url": "https://api.example.com/openapi.json", "type": "openapi" }
    ],
    "workflows": [
        {
            "workflowId": "getPet",
            "steps": [
                {
                    "stepId": "findPet",
                    "operationId": "getPetById",
                    "successCriteria": [ { "condition": "$statusCode == 200" } ]
                }
            ]
        }
    ]
}"#).unwrap();

doc.validate(EnumSet::empty()).expect("description is well-formed");
assert_eq!(doc.workflows[0].workflow_id, "getPet");

YAML descriptions work the same way — parse with serde_yaml_ng (or any other YAML crate) into v1_0::Description.

§Versions

v1.0.x (v1_0, default feature) and v1.1.x ([v1_1]) are both implemented; enable whichever you need. With both features enabled, an impl From<v1_0::Description> for v1_1::Description is available for upconverting an existing v1.0 description.

Modules§

common
Version-agnostic helpers shared across Arazzo versions.
v1_0
Arazzo v1.0 — see https://spec.openapis.org/arazzo/v1.0.1.html.
validation
Validation framework for Arazzo documents.