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

Restructure validate command to use SchemaDirectory #831

Open
willosborne opened this issue Jan 23, 2025 · 0 comments
Open

Restructure validate command to use SchemaDirectory #831

willosborne opened this issue Jan 23, 2025 · 0 comments

Comments

@willosborne
Copy link
Member

Feature Request

Description of Problem:

Currently the validate command uses its own logic to load schemas. This is custom, poorly tested and also can make remote URL calls to fetch non-file paths which may present a security issue.

This depends on #830

Potential Solutions:

Suggested approach is to remove the logic in the loadMetaSchemas() method and instead have that initialise the SchemaDirectory.

Then the loadSchema callback when initialising ajv will just defer to the SchemaDirectory, rather than loading any files.
That way the directory has control of what is loaded, and also any error handling logic.

ajv will still handle pulling references out - so only the schema loading features of the directory are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant