feat: automated AsyncAPI generation from Go structs - #8
Draft
jpower432 wants to merge 11 commits into
Draft
Conversation
Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Implements AST-based parser that walks Go source files and returns []EventSpec values from structs annotated with the asyncapi sentinel blank field pattern. Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Remove unreachable `if field.Names != nil` guard in extractEventSpec and replace string-concatenated temp path with filepath.Join in test. Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Implements BuildDoc() converting []EventSpec to an AsyncAPIDoc model with channels, send/receive operations, CloudEvents envelope schemas, data schemas, and NATS JetStream bindings. Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Adds missing assertion to TestBuildDoc_Operations verifying that the receive operation carries an empty NATS stream (binding is send-only). Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Implements WriteYAML to marshal AsyncAPIDoc to disk with SPDX header and 0o644 permissions. Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Replaces the stub main.go with the full CLI entry point that wires ParseFile, BuildDoc, and WriteYAML together. Adds the go:generate directive and asyncapi sentinel tag to events/events.go, and commits the generated api/events/asyncapi.yaml. Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Adds generate, asyncapi-lint, and an expanded check task to Taskfile.yml. Fixes NATS binding: stream name moved to x-stream extension (valid per AsyncAPI spec extensions), bindingVersion set to 0.1.0 (was "latest"). Adds nolint directives for gosec G306 on intentional 0o644 file writes. Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Extends BuildDoc and the asyncapi-gen CLI with optional -description, -license, -contact-name, and -contact-url flags. Updates the go:generate directive in events/events.go and regenerates api/events/asyncapi.yaml with the full metadata matching the original hand-authored file. Assisted-by: Claude (Anthropic, Claude Sonnet 4.6) Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Please include a summary of the changes and the context of this PR.
Related Issues
Inform any issues relevant to this PR. For example:
Review Hints
Review hints here. Replace this text. Don't use the italics format!
Use this optional section to give any relevant information that could help the reviewer to more quickly and assertively understand and test the changes.
Good examples are useful commands, if it is better to review all commits together or in a suggested sequence, any relevant discussion in other PRs or issues, etc.