Skip to content

Commit

Permalink
Changes snake cased fields to camel casing
Browse files Browse the repository at this point in the history
This commit improves consistency in our spec and examples by having all
keys be camel cased.

This made 4 changes:
chain_id -> chainId
context_id -> contextId
link_kind -> linkKind
link_type -> linkType

Signed-off-by: xibz <impactbchang@gmail.com>
  • Loading branch information
xibz committed May 14, 2024
1 parent f1dbd63 commit 2816601
Show file tree
Hide file tree
Showing 90 changed files with 302 additions and 280 deletions.
21 changes: 21 additions & 0 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins:
- jsonc
overrides:
- files: "*.json"
parser: "jsonc-eslint-parser"
rules:
# These are the set of rules that belong to jsonc. For more information,
# https://ota-meshi.github.io/eslint-plugin-jsonc/rules
jsonc/comma-dangle:
- error
jsonc/indent:
- error
- 2
jsonc/key-name-casing:
- error
- camelCase: true
snake_case: false
jsonc/key-spacing:
- error
jsonc/no-dupe-keys:
- error
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_MARKDOWN: true
VALIDATE_JSON: true

jsonschema:
name: Validate Schemas and Examples
Expand Down
174 changes: 87 additions & 87 deletions custom/schema.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cdevents.dev/0.4.0/schema/custom",
"properties": {
"context": {
"properties": {
"version": {
"type": "string",
"minLength": 1
},
"id": {
"type": "string",
"minLength": 1
},
"source": {
"type": "string",
"minLength": 1,
"format": "uri-reference"
},
"type": {
"type": "string",
"pattern": "^dev.cdeventsx.[a-zA-Z0-9]+-[a-zA-Z]+.[a-zA-Z]+$"
},
"timestamp": {
"type": "string",
"format": "date-time"
},
"schemaUri": {
"type": "string",
"minLength": 1,
"format": "uri"
}
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cdevents.dev/0.4.0/schema/custom",
"properties": {
"context": {
"properties": {
"version": {
"type": "string",
"minLength": 1
},
"additionalProperties": false,
"type": "object",
"required": [
"version",
"id",
"source",
"type",
"timestamp"
]
},
"subject": {
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"source": {
"type": "string",
"minLength": 1,
"format": "uri-reference"
},
"type": {
"type": "string",
"pattern": "^[a-zA-Z0-9]+-[a-zA-Z]+$"
},
"content": {
"type": "object",
"additionalProperties": true
}
"id": {
"type": "string",
"minLength": 1
},
"source": {
"type": "string",
"minLength": 1,
"format": "uri-reference"
},
"type": {
"type": "string",
"pattern": "^dev.cdeventsx.[a-zA-Z0-9]+-[a-zA-Z]+.[a-zA-Z]+$"
},
"additionalProperties": false,
"type": "object",
"required": [
"id",
"type",
"content"
]
"timestamp": {
"type": "string",
"format": "date-time"
},
"schemaUri": {
"type": "string",
"minLength": 1,
"format": "uri"
}
},
"customData": {
"oneOf": [
{
"type": "object"
},
{
"type": "string",
"contentEncoding": "base64"
}
]
"additionalProperties": false,
"type": "object",
"required": [
"version",
"id",
"source",
"type",
"timestamp"
]
},
"subject": {
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"source": {
"type": "string",
"minLength": 1,
"format": "uri-reference"
},
"type": {
"type": "string",
"pattern": "^[a-zA-Z0-9]+-[a-zA-Z]+$"
},
"content": {
"type": "object",
"additionalProperties": true
}
},
"customDataContentType": {
"type": "string"
}
"additionalProperties": false,
"type": "object",
"required": [
"id",
"type",
"content"
]
},
"customData": {
"oneOf": [
{
"type": "object"
},
{
"type": "string",
"contentEncoding": "base64"
}
]
},
"additionalProperties": false,
"type": "object",
"required": [
"context",
"subject"
]
}
"customDataContentType": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"context",
"subject"
]
}
2 changes: 1 addition & 1 deletion examples/artifact_packaged.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.packaged.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/artifact_published.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.published.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/artifact_signed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.artifact.signed.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/branch_created.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.branch.created.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/branch_deleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.branch.deleted.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/build_finished.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.build.finished.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/build_queued.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.build.queued.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/build_started.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.build.started.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/change_abandoned.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.change.abandoned.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/change_created.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.change.created.0.3.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/change_merged.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.change.merged.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/change_reviewed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.change.reviewed.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/change_updated.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.change.updated.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/environment_created.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.environment.created.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/environment_deleted.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.environment.deleted.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
2 changes: 1 addition & 1 deletion examples/environment_modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"context": {
"version": "0.4.0",
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
"chain_id": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
"source": "/event/source/123",
"type": "dev.cdevents.environment.modified.0.2.0",
"timestamp": "2023-03-20T14:27:05.315384Z",
Expand Down
Loading

0 comments on commit 2816601

Please sign in to comment.