Skip to content

alignment of $id and context.type in schema #187

@davidB

Description

@davidB

value of $id should be aligned with context.type:

  • context.type follow the format: dev.cdevents.{{subject}}.{{predicate}}.{{subject_predicate_version}}
  • $id should follow the format: https://cdevents.dev/{{spec_version}}/schema/{{subject}}-{{predicate}}-event
  "$id": "https://cdevents.dev/0.4.0-draft/schema/pipeline-run-queued-event",
  "properties": {
    "context": {
      "properties": {
...
        "type": {
          "type": "string",
          "enum": [
            "dev.cdevents.pipelinerun.queued.0.1.1"
          ],
          "default": "dev.cdevents.pipelinerun.queued.0.1.1"

Side questions:

  1. what is the value of event at the end of $id?
  2. why not having the version of {{subject_predicate_version}} as part of $id? (and maybe remove the {{spec_version}}, to have a full alignment between $id and context.type?

Notes

from @afrittoli :

changing the IDs is a relatively small change in the spec, only events with a double word subject will be affected. The logic in the cdevents.dev repo needs to be updated so that both the old URL and the new one are published, since we cannot break the links in the IDs for older versions

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions