Repository navigation
feat: check AsyncAPI sources in Arazzo source validation - #324
TristanSpeakEasy merged 7 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Shadow auto-approve: would not auto-approve because issues were found.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 6 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would require human review. Adds AsyncAPI source loading and validation with new errors and warnings; the dismissed additionalProperties-header warning still applies, and the new validation semantics are product decisions needing human sign-off.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Shadow auto-approve: would not auto-approve because issues were found.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would require human review. Adds AsyncAPI source loading and validation with new errors and warnings; the dismissed additionalProperties-header warning still applies, and validation strictness/spec choices remain human decisions.
View guided diff | Turn on auto-fix | Re-trigger cubic
* feat: add openapi asyncapi validate command * chore: update cmd/openapi to the root module with the asyncapi package * docs: describe the AsyncAPI header check in arazzo validate help * chore: pin the CLI to the latest AsyncAPI stack root module * test: cover the asyncapi CLI command wiring and resolution errors * test: don't execute the process-exiting asyncapi command in tests
b6b4880
into
feat/asyncapi-stage3-references
…t rules (#323) * feat: resolve AsyncAPI references, apply traits and check cross-object rules * fix: address AsyncAPI reference resolution review feedback * perf: skip the explicit null lookup for fields that are set * test: drop the AsyncAPI channel SyncChanges error test now that null handling is generic * fix: report AsyncAPI diagnostics on trait-merged mappings at the winning contributor * test: cover AsyncAPI reference resolution, traits, checks and null syncing * test: address review feedback on AsyncAPI stage 3 coverage tests * feat: check AsyncAPI sources in Arazzo source validation (#324) * feat: check AsyncAPI sources in Arazzo source validation * fix: treat an empty AsyncAPI operation messages list as no messages * test: cover AsyncAPI step target edge cases in Arazzo source validation * test: assert the load warning in the AsyncAPI source edge case tests * feat: add openapi asyncapi validate command (#326) * feat: add openapi asyncapi validate command * chore: update cmd/openapi to the root module with the asyncapi package * docs: describe the AsyncAPI header check in arazzo validate help * chore: pin the CLI to the latest AsyncAPI stack root module * test: cover the asyncapi CLI command wiring and resolution errors * test: don't execute the process-exiting asyncapi command in tests
…and walking (#322) * feat: add complete AsyncAPI 3.x document model with local validation and walking * fix: address AsyncAPI document model review feedback * test: cover the AsyncAPI stage 2 document model, walker and references * feat: resolve AsyncAPI references, apply traits and check cross-object rules (#323) * feat: resolve AsyncAPI references, apply traits and check cross-object rules * fix: address AsyncAPI reference resolution review feedback * perf: skip the explicit null lookup for fields that are set * test: drop the AsyncAPI channel SyncChanges error test now that null handling is generic * fix: report AsyncAPI diagnostics on trait-merged mappings at the winning contributor * test: cover AsyncAPI reference resolution, traits, checks and null syncing * test: address review feedback on AsyncAPI stage 3 coverage tests * feat: check AsyncAPI sources in Arazzo source validation (#324) * feat: check AsyncAPI sources in Arazzo source validation * fix: treat an empty AsyncAPI operation messages list as no messages * test: cover AsyncAPI step target edge cases in Arazzo source validation * test: assert the load warning in the AsyncAPI source edge case tests * feat: add openapi asyncapi validate command (#326) * feat: add openapi asyncapi validate command * chore: update cmd/openapi to the root module with the asyncapi package * docs: describe the AsyncAPI header check in arazzo validate help * chore: pin the CLI to the latest AsyncAPI stack root module * test: cover the asyncapi CLI command wiring and resolution errors * test: don't execute the process-exiting asyncapi command in tests
* feat: add AsyncAPI stage 1 foundations (version policy, root/info models, AsyncAPI JSON Schema) * fix: address AsyncAPI stage 1 review feedback * fix: don't repeat the location in AsyncAPI schema type mismatch messages * test: cover the AsyncAPI stage 1 schema, info and version models * feat: add complete AsyncAPI 3.x document model with local validation and walking (#322) * feat: add complete AsyncAPI 3.x document model with local validation and walking * fix: address AsyncAPI document model review feedback * test: cover the AsyncAPI stage 2 document model, walker and references * feat: resolve AsyncAPI references, apply traits and check cross-object rules (#323) * feat: resolve AsyncAPI references, apply traits and check cross-object rules * fix: address AsyncAPI reference resolution review feedback * perf: skip the explicit null lookup for fields that are set * test: drop the AsyncAPI channel SyncChanges error test now that null handling is generic * fix: report AsyncAPI diagnostics on trait-merged mappings at the winning contributor * test: cover AsyncAPI reference resolution, traits, checks and null syncing * test: address review feedback on AsyncAPI stage 3 coverage tests * feat: check AsyncAPI sources in Arazzo source validation (#324) * feat: check AsyncAPI sources in Arazzo source validation * fix: treat an empty AsyncAPI operation messages list as no messages * test: cover AsyncAPI step target edge cases in Arazzo source validation * test: assert the load warning in the AsyncAPI source edge case tests * feat: add openapi asyncapi validate command (#326) * feat: add openapi asyncapi validate command * chore: update cmd/openapi to the root module with the asyncapi package * docs: describe the AsyncAPI header check in arazzo validate help * chore: pin the CLI to the latest AsyncAPI stack root module * test: cover the asyncapi CLI command wiring and resolution errors * test: don't execute the process-exiting asyncapi command in tests * refactor: return AsyncAPI reference chain results by value * chore: pin cmd/openapi to the merged AsyncAPI root module commit * test: use a platform absolute path in the AsyncAPI absolute reference test * test: cover the remaining AsyncAPI patch lines and drop unreachable error branches * chore: pin cmd/openapi to the latest AsyncAPI root module commit
Stacked on #323, which is stacked on #322 and #321. Review those first; this PR's base is the #323 branch. It doesn't depend on the Stage 4 CLI command.
Why
Arazzo 1.1 steps can target AsyncAPI documents with
operationIdorchannelPath, but since #305LoadSourceDescriptionsskips AsyncAPI sources with a hint andValidateSourcesnever checks those steps. A typo in an AsyncAPI operation key or channel pointer only shows up at runtime. With theasyncapipackage from #321 to #323 the gap is wiring, so this connects the two.What changed
VirtualFSandHTTPClient.SourceDocumentgets anAsyncAPIfield. Declared type mismatches work as before. AsyncAPI 2.x sources get an "unsupported version" warning and aren't checked. Unresolved references give the same "some checks may be skipped" warning as OpenAPI, while warnings from resolution (such as an Avro schema that isn't validated) are ignored.operationIdis looked up by key in the rootoperationsmap.channelPathis a JSON Pointer to a channel key under/channelsor/components/channels, never itsaddress.operationPathinto an AsyncAPI source is an error.messages, or all messages of its channel, with traits applied):channelPathinto a non-AsyncAPI source, an untyped source detected as AsyncAPI with noaction, andactionon a step whose untyped source turns out to be OpenAPI.requestBodyon areceivestep, andcorrelationIdwhen no message declares one.arazzo/README.mdgets an "AsyncAPI sources" section covering what's checked and what deliberately isn't, and the CLI README is updated.arazzo validateandarazzo lintneed no code change.Review notes
operationPathis rejected rather than supported. Arazzo 1.1 only namesoperationIdandchannelPathfor AsyncAPI steps, and feat!: add Arazzo 1.1 support with source validation, lint, graph, bootstrap and explore commands #305 already requiresactionfor AsyncAPI steps while forbidding it withoperationPath. Supporting it would make a step that can never be valid look fine.actionisn't compared with the AsyncAPI operationaction. The step describes the workflow's side and the operation the application's, and Arazzo doesn't define how they relate.async-valid.arazzo.yamlhas a step with the opposite action to show it's accepted.{orderId}) have no matching Arazzo parameter location, so any non-header location is a warning rather than being mapped to channel parameters.if,patternPropertiesor a non JSON Schema format. Header names are matched case-insensitively.$message.payload.orderId, which the 1.1 expression grammar (as implemented in feat!: add Arazzo 1.1 support with source validation, lint, graph, bootstrap and explore commands #305) rejects, so the regression fixture uses$message.payload#/orderId. I didn't loosen the grammar here.cmd/openapimodule picks this up once its root module dependency is bumped. Noreplacedirective.Testing
arazzo/sourcevalidation_asyncapi_test.gowith new fixtures underarazzo/testdata/sources/:placeOrdersend,confirmOrderreceive), including a message from another file with a header and correlation ID from a trait,/components/channels, an escaped channel key (orders~1legacy), a composed headers schema and a differing action. It validates cleanly.arazzo/sources_test.go: AsyncAPI 3.0 and 3.1 loading from a file and over HTTP, 2.x warning, type mismatches in both directions, unresolved references, and resolution warnings being ignored.source_description_typenow suggestsasyncapifor an untyped AsyncAPI source.mise test ./arazzo/... ./asyncapi/...andmise cipass locally.mise ciruns outside the sandbox because the JSON Schema suite needslocalhost:1234.Summary by cubic
Validates Arazzo 1.1 steps that target AsyncAPI sources, closing the gap where
operationId,channelPath, andoperationPathsteps were only checked structurally, and adds anopenapi asyncapi validatecommand.AsyncAPI source checks
asyncapipackage using the caller'sVirtualFSandHTTPClient; 2.x sources warn as unsupported.operationIdmust be a key in the rootoperationsmap;channelPathmust be a JSON Pointer to a channel key under/channelsor/components/channels;operationPathis an error for AsyncAPI sources.requestBodyon areceivestep andcorrelationIdwith no message declaration warn, andactionis required on an untyped source detected as AsyncAPI.if,patternProperties, or a non-JSON Schema format. An explicitly emptymessageslist means the operation has no messages rather than falling back to the channel's.source_description_typefix now suggestsasyncapifor loaded untyped sources.AsyncAPI CLI
openapi asyncapi validatechecks AsyncAPI 3.x documents with--resolve,--base-uri, and--strict, and lists unfollowed references and unvalidated schema formats as "Not checked" so a passing result isn't mistaken for complete validation.Written for commit cc972a1. Summary will update on new commits.