Skip to content

Propagate mqtt binding parse errors instead of silently skipping #14

Description

@mlilback

Follow-up from Copilot's review on #12.

The extract_mqtt_*_bindings functions in asyncapi-rust-codegen/src/asyncapi_spec_attrs.rs construct syn::Errors for missing required fields (e.g. last_will sub-fields), but the result of nested.parse_nested_meta(...) is assigned to _ and discarded. Invalid bindings are therefore skipped silently rather than surfaced to the user.

Proposed fix: return syn::Result from the extractors and emit err.to_compile_error() from the macro expansion so malformed mqtt(...) attributes fail fast with a clear diagnostic.

Deferred out of #12 to keep that PR scoped to the feature; the discarded-error pattern predates it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions