-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add field descriptions, JSON Schema output, and review fixes #9
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
Merged
hbraswelrh
merged 19 commits into
complytime:main
from
hbraswelrh:opsx/asyncapi-codegen-pipeline
Aug 20, 2026
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cdff097
chore: add gopkg.in/yaml.v3 dependency
jpower432 d642d28
feat: add asyncapi-gen parser
jpower432 4b01511
fix: address review findings in asyncapi-gen parser
jpower432 18a7636
feat: add asyncapi-gen schema builder
jpower432 b6377e8
test: assert receive op has no NATS binding
jpower432 cd0826a
feat: add asyncapi-gen YAML writer
jpower432 3acea3a
feat: add asyncapi-gen CLI and wire go:generate
jpower432 f838fcf
test: add asyncapi-gen drift detection integration test
jpower432 7924cf9
chore: add generate and asyncapi-lint tasks
jpower432 fb87303
chore: go mod tidy — promote yaml.v3 to direct dependency
jpower432 46e9e40
feat: add description, license, and contact flags to asyncapi-gen
jpower432 a6c28f7
feat: add field descriptions, JSON Schema output, and review fixes
hbraswelrh 2b472d0
ci: validate AsyncAPI spec in GitHub Actions
hbraswelrh 6d5be31
docs: add event versioning strategy
hbraswelrh 8fb12a4
refactor: extract testable run() function and improve test coverage
hbraswelrh be0f1b5
fix: removes setup-task dependency
hbraswelrh 951376e
fix: adds channel and data description support
hbraswelrh 9c52dce
fix: updates asyncapi to use go-task/setup-task
hbraswelrh 2a82a49
fix: address review council findings from PR #9
hbraswelrh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Validates the generated AsyncAPI spec via @asyncapi/cli on push and PR to main. | ||
| name: AsyncAPI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Set up Task | ||
| uses: go-task/setup-task@a00fbb05ce67b35648be3c78cbc9fd85354c757e # v2.2.0 | ||
| with: | ||
| version: '3.40.1' | ||
|
|
||
| - name: Validate AsyncAPI spec | ||
| run: task asyncapi-lint | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,4 +29,4 @@ jobs: | |
| run: go vet ./... | ||
|
|
||
| - name: Run tests | ||
| run: go test ./... -v | ||
| run: go test -race -count=1 ./... -v | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,122 +1,116 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| asyncapi: 3.0.0 | ||
| info: | ||
| title: ComplyTime API Events | ||
| version: 0.1.0 | ||
| description: | | ||
| Event contract for the ComplyTime evidence lifecycle. | ||
|
|
||
| All public events use CloudEvents v1.0 envelope (JSON format). | ||
| The AsyncAPI spec is the source of truth for event contracts; | ||
| Go types in the events package must match these schemas. | ||
| license: | ||
| name: Apache-2.0 | ||
| contact: | ||
| name: ComplyTime | ||
| url: https://github.com/complytime/complyapi | ||
| title: ComplyTime API Events | ||
| version: 0.1.0 | ||
| description: |- | ||
| Event contract for the ComplyTime evidence lifecycle. | ||
|
|
||
| All public events use CloudEvents v1.0 envelope (JSON format). | ||
| This spec is generated from Go types in the events package via cmd/asyncapi-gen. | ||
| Do not edit manually — run 'go generate ./events/...' to regenerate. | ||
| license: | ||
| name: Apache-2.0 | ||
| contact: | ||
| name: ComplyTime | ||
| url: https://github.com/complytime/complyapi | ||
| defaultContentType: application/cloudevents+json | ||
|
|
||
| servers: | ||
| nats: | ||
| host: localhost:4222 | ||
| protocol: nats | ||
| channels: | ||
| evidenceIngested: | ||
| address: core.evidence.ingested.{subjectId} | ||
| description: | | ||
| Published when evidence is ingested, before sealing. | ||
| parameters: | ||
| subjectId: | ||
| description: The compliance subject identifier (e.g. `my-app-v1`) | ||
| messages: | ||
| evidenceIngested: | ||
| $ref: '#/components/messages/evidenceIngested' | ||
|
|
||
| evidenceIngested: | ||
| address: core.evidence.ingested.{subjectId} | ||
| description: Evidence ingestion pipeline for compliance artifacts | ||
| parameters: | ||
| subjectId: | ||
| description: The compliance subject identifier | ||
| messages: | ||
| EvidenceIngested: | ||
| $ref: '#/components/messages/EvidenceIngested' | ||
| operations: | ||
| publishEvidenceIngested: | ||
| action: send | ||
| channel: | ||
| $ref: '#/channels/evidenceIngested' | ||
| summary: Published when evidence is accepted for processing. | ||
|
|
||
| consumeEvidenceIngested: | ||
| action: receive | ||
| channel: | ||
| $ref: '#/channels/evidenceIngested' | ||
| summary: Consume evidence-ingested events. | ||
|
|
||
| consumeEvidenceIngested: | ||
| action: receive | ||
| summary: Consume evidence-ingested events | ||
| channel: | ||
| $ref: '#/channels/evidenceIngested' | ||
| publishEvidenceIngested: | ||
| action: send | ||
| summary: Published when evidence is accepted for processing; before sealing | ||
| channel: | ||
| $ref: '#/channels/evidenceIngested' | ||
| bindings: | ||
| nats: | ||
| x-stream: EVIDENCE | ||
| bindingVersion: 0.1.0 | ||
| components: | ||
| messages: | ||
| evidenceIngested: | ||
| name: EvidenceIngested | ||
| title: Evidence Ingested | ||
| contentType: application/cloudevents+json | ||
| payload: | ||
| $ref: '#/components/schemas/EvidenceIngestedCloudEvent' | ||
|
|
||
| schemas: | ||
| EvidenceIngestedCloudEvent: | ||
| type: object | ||
| description: CloudEvents v1.0 envelope for evidence.ingested | ||
| required: | ||
| - specversion | ||
| - id | ||
| - type | ||
| - source | ||
| - subject | ||
| - time | ||
| - datacontenttype | ||
| - data | ||
| properties: | ||
| specversion: | ||
| type: string | ||
| const: "1.0" | ||
| id: | ||
| type: string | ||
| format: uuid | ||
| type: | ||
| type: string | ||
| const: dev.complytime.evidence.ingested | ||
| source: | ||
| type: string | ||
| description: URI identifying the producing service | ||
| examples: | ||
| - complytime-gateway | ||
| subject: | ||
| type: string | ||
| description: The compliance subject identifier | ||
| time: | ||
| type: string | ||
| format: date-time | ||
| datacontenttype: | ||
| type: string | ||
| const: application/json | ||
| data: | ||
| $ref: '#/components/schemas/EvidenceIngestedData' | ||
|
|
||
| EvidenceIngestedData: | ||
| type: object | ||
| description: Payload for evidence.ingested events. | ||
| required: | ||
| - contentDigest | ||
| - artifactType | ||
| - subjectId | ||
| properties: | ||
| contentDigest: | ||
| type: string | ||
| description: SHA-256 digest of the evidence artifact | ||
| examples: | ||
| - sha256:abc123... | ||
| artifactType: | ||
| type: string | ||
| description: Gemara artifact type | ||
| examples: | ||
| - application/vnd.gemara.evaluation-log+json | ||
| storageRef: | ||
| type: string | ||
| description: Internal storage reference | ||
| subjectId: | ||
| type: string | ||
| description: Compliance subject identifier | ||
| examples: | ||
| - my-app-v1 | ||
| shardId: | ||
| type: string | ||
| description: Subject shard identifier (null when sharding is not configured) | ||
| messages: | ||
| EvidenceIngested: | ||
| name: EvidenceIngested | ||
| title: Evidence Ingested | ||
| contentType: application/cloudevents+json | ||
| payload: | ||
| $ref: '#/components/schemas/EvidenceIngestedCloudEvent' | ||
| schemas: | ||
| EvidenceIngestedCloudEvent: | ||
| type: object | ||
| description: CloudEvents v1.0 envelope for dev.complytime.evidence.ingested | ||
| required: | ||
| - specversion | ||
| - id | ||
| - type | ||
| - source | ||
| - subject | ||
| - time | ||
| - datacontenttype | ||
| - data | ||
| properties: | ||
| data: | ||
| $ref: '#/components/schemas/EvidenceIngestedData' | ||
| datacontenttype: | ||
| type: string | ||
| const: application/json | ||
| id: | ||
| type: string | ||
| format: uuid | ||
| source: | ||
| type: string | ||
| description: URI identifying the producing service | ||
| specversion: | ||
| type: string | ||
| const: "1.0" | ||
| subject: | ||
| type: string | ||
| description: The compliance subject identifier | ||
| time: | ||
| type: string | ||
| format: date-time | ||
| type: | ||
| type: string | ||
| const: dev.complytime.evidence.ingested | ||
| EvidenceIngestedData: | ||
| type: object | ||
| description: |- | ||
| EvidenceIngestedData is the CloudEvents data payload for | ||
| evidence.ingested events. | ||
| required: | ||
| - contentDigest | ||
| - artifactType | ||
| - subjectId | ||
| properties: | ||
| artifactType: | ||
| type: string | ||
| description: Gemara artifact type | ||
| contentDigest: | ||
| type: string | ||
| description: SHA-256 digest of the evidence artifact | ||
| shardId: | ||
| type: string | ||
| description: Subject shard identifier (null when sharding is not configured) | ||
| storageRef: | ||
| type: string | ||
| description: Internal storage reference | ||
| subjectId: | ||
| type: string | ||
| description: Compliance subject identifier |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.