Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using $ref resolver outside validation #422

Open
jpmckinney opened this issue Mar 22, 2023 · 0 comments
Open

Using $ref resolver outside validation #422

jpmckinney opened this issue Mar 22, 2023 · 0 comments

Comments

@jpmckinney
Copy link

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"}
    }
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant