Skip to content

Infrahub: Schema file locations #4791

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

FragmentedPacket
Copy link

Add models/.yml and schemas/.yml for OpsMill's Infrahub schema file locations.

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@hyperupcall
Copy link
Member

hyperupcall commented Jun 15, 2025

Thanks - could you use a more generic file pattern? Both of those have a high chance of creating false positives.

@FragmentedPacket
Copy link
Author

Thanks for the quick response! We discussed internally and attempting to start looking into how Kubernetes does this for their YAML files that do not have a naming standard either.

Would we follow the same path as https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/kubernetes-definitions.json? It looks like some code editors will try all schemas that are available at the schemastore URI and this would allow us to provide auto-mapping based on matching the keys with the JSON file we provide in src/schemas/json?

Am I understanding this correctly?

@hyperupcall
Copy link
Member

Would we follow the same path as https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/kubernetes-definitions.json?

Sorry, I don't follow - if you create a separate definition file, you will still need a "main schema" that has to be matched against a file pattern

It looks like some code editors will try all schemas that are available at the schemastore URI and this would allow us to provide auto-mapping based on matching the keys with the JSON file we provide in src/schemas/json?

Which code editors are those? To my knowledge there unfortunately isn't a way for editors to use certain schemas based on the existence of certain keys - that's tracked by #3658.

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

Successfully merging this pull request may close these issues.

2 participants