Skip to content

internal://provided-schema/ should be ignored by URI retriever #538

New issue

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

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

Already on GitHub? # to your account

Closed
estahn opened this issue Oct 26, 2018 · 4 comments
Closed

internal://provided-schema/ should be ignored by URI retriever #538

estahn opened this issue Oct 26, 2018 · 4 comments

Comments

@estahn
Copy link
Contributor

estahn commented Oct 26, 2018

Message was: "file_get_contents(internal://provided-schema/definitions.schema.json): failed to open stream: No such file or directory

@ricardofiorani
Copy link

I'm having the exact same problem on a lib that depends on this one.

@ricardofiorani
Copy link

Ok, I explained how I solved it in here -> PaddleHQ/openapi-validator#6
I hope it helps anyone to either solve this issue on their projects or someone to create a bugfix for this

@firewaller
Copy link

firewaller commented May 13, 2022

FYI this is a feature added here: b1ee0e8

The solution is to use addSchema() to set your own manually (from README), otherwise it will default to the placeholder above:

// The SchemaStorage can resolve references, loading additional schemas from file as needed, etc.
$schemaStorage = new SchemaStorage();

// This does two things:
// 1) Mutates $jsonSchemaObject to normalize the references (to file://mySchema#/definitions/integerData, etc)
// 2) Tells $schemaStorage that references to file://mySchema... should be resolved by looking in $jsonSchemaObject
$schemaStorage->addSchema('file://mySchema', $jsonSchemaObject);

// Provide $schemaStorage to the Validator so that references can be resolved during validation
$jsonValidator = new Validator( new Factory($schemaStorage));

@DannyvdSluijs
Copy link
Collaborator

@estahn in an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it safe to assume this is a rather old issue, which was provided with some answer and can be closed? Feel free to close it yourself with some comments if helpful.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants