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

ID passed to SchemaLoader::loadObjectSchema() should take precedence over $id in schema data #106

Open
bradjones1 opened this issue May 9, 2022 · 0 comments

Comments

@bradjones1
Copy link

Sometimes schema files have more specific $ids than their well-known/canonical URLs. E.g.,

https://jsonapi.org/schema vs. https://jsonapi.org/schemas/spec/v1.0/draft

I may be using a local file with that more specific/versioned $id, but other schemas will reference the canonical version. If I choose to explicitly set the ID in ::loadObjectSchema(), we should use that. Except, it's overridden at

if (property_exists($schema, '$id')) {
$existent = true;
$id = Uri::parse($schema->{'$id'}, true);
}

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