Skip to content

Using $ref resolver outside validationΒ #422

@jpmckinney

Description

@jpmckinney

Is there currently functionality to transform a JSON Schema with $ref properties into a dereferenced JSON Schema (with sub-schema containing $ref properties replaced by the referenced schema)? e.g.

let mut schema = json!({
    "properties": {
        "foo": {"title": "Foo"},
        "bar": {"$ref": "#/properties/foo"}
    }
});

JSONSchema::dereference(&mut schema);

assert_eq!(schema, json!({
    "properties": {
        "foo": {"title": "Foo"},
        "bar": {"title": "Foo"}
    }
}))

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions