buildkite / pipeline-schema

A JSON schema for Buildkite’s pipeline file format
MIT License
31 stars 35 forks source link

Schema vs Doc inconsistency regarding `key` vs `identifier` vs `id` attributes? #76

Open AliSoftware opened 3 months ago

AliSoftware commented 3 months ago

The inconsistency

My understanding of the current state

I believe the doc is correct, as it matches the behavior we see in practice.

My guess is that maybe (?) key was named id/identifier a long time ago, but Buildkite changed it to key since, and kept the identifier as an alias for backwards compatibility… while making id private because it would probably now be a generated UUID (the one corresponding to the BUILDKITE_STEP_ID env var value?) instead of a user-provided one. So they updated the docs accordingly… but forgot to fully update the schema in line, only adding a definition for the key attribute but not updating the schema definition to remove id nor to make identifier backwards-compat alias now point to #/definitions/commonOptions/key instead of #/definitions/commonOptions/identifier?

thejcannon commented 4 days ago

Wonder if https://json-schema.org/draft/2019-09/json-schema-validation#rfc.section.9.3 could be leveraged