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

k3d: reference versions schema in k3d repo #2057

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

iwilltry42
Copy link
Contributor

I'm a bit confused when it comes to handling url and versions entries.
Is url just pointing to the default? How are versions handled?
If url is the default, would you recommend to have a copy of the most recent schema file in an unversioned path, so it doesn't change?

@madskristensen
Copy link
Contributor

madskristensen commented Jan 28, 2022

url is the default and versions lists all the available versions. Let me know when this is ready to be merged

@GerryFerdinandus
Copy link
Contributor

GerryFerdinandus commented Jan 28, 2022

@iwilltry42
Some extra explanation.

Without version on Schemastore example:

{
"name": "Ory Hydra configuration",
"description": "Schema for Ory Hydra configuration file",
"fileMatch": [
"hydra.json",
"hydra.yml",
"hydra.yaml",
"hydra.toml"
],
"url": "https://raw.githubusercontent.com/ory/hydra/master/.schema/version.schema.json"
},

And use multiple schemas on the remote site:
https://raw.githubusercontent.com/ory/hydra/master/.schema/version.schema.json

Remark:
An alternative for better efficiency is to use "AnyOf" instead of "OneOf".
In this way, the validators only need to validate data against schemas until the first schema matches. Put the most popular version at the top (normally the latest version) and less popular version at the bottom of the list.

@iwilltry42 iwilltry42 marked this pull request as draft January 28, 2022 18:16
iwilltry42 added a commit to k3d-io/k3d that referenced this pull request Jan 28, 2022
- embed a versions file in the k3d repo that links to the existing config schemas as per SchemaStore/schemastore#2057 (comment)
- inspired by and mostly copied from https://github.com/ory/kratos/blob/master/.schema/version.schema.json 🙏
@iwilltry42 iwilltry42 changed the title k3d: v1alpha3 as default k3d: reference versions schema in k3d repo Jan 28, 2022
@iwilltry42 iwilltry42 marked this pull request as ready for review January 28, 2022 18:32
@iwilltry42
Copy link
Contributor Author

Thanks @madskristensen !
@GerryFerdinandus , thank you, that Ory example looks perfect :)

@madskristensen: ready for review 👍

@GerryFerdinandus GerryFerdinandus merged commit bcbcf64 into SchemaStore:master Jan 28, 2022
@GerryFerdinandus
Copy link
Contributor

Thanks

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.

3 participants