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

fix(api/jsonschema): use unchanging JSON Schema version #14092

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rogpeppe
Copy link

Motivation

The current value of $schema in api/jsonschema/schema.json refers to a schema version that changes over time, which means that there's a possibility that the keywords used in the schema might change meaning unexpectedly when a new version is released.

Modifications

This PR fixes the schema version to the current latest version, avoiding this potential issue by locking in the expected JSON Schema semantics and meaning that any would-be interpreter does not have to make a network request to find out what version is intended.

Verification

I checked that the new schema validates OK in a JSON schema checker.

Aside

A passing remark with regard to this comment in hack/api/jsonschema/main.go:

"$id":     "http://workflows.argoproj.io/workflows.json", // don't really know what this should be

It seems relatively common to use a working URL for JSON schemas URIs so this could potentially be changed to:

"$id":     "https://raw.githubusercontent.com/argoproj/argo-workflows/HEAD/api/jsonschema/schema.json",

The current value of `$schema` in `api/jsonschema/schema.json` refers to
a schema version that changes over time, which means that there's a
possibility that the keywords used in the schema might change meaning
unexpectedly when a new version is released.

This PR fixes the schema version to the current latest version, avoiding
this potential issue by locking in the expected JSON Schema semantics
and meaning that any would-be interpreter does not have to make a
network request to find out what version is intended.

I checked that the new schema validates OK in a JSON schema checker.

A passing remark with regard to this comment in
`hack/api/jsonschema/main.go`:

```
"$id":     "http://workflows.argoproj.io/workflows.json", // don't really know what this should be
```

It seems relatively common to use a working URL for JSON schemas URIs so
this could potentially be changed to:

```
"$id":     "https://raw.githubusercontent.com/argoproj/argo-workflows/HEAD/api/jsonschema/schema.json",
```

Signed-off-by: Roger Peppe <[email protected]>
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.

1 participant