Generic types in #[asyncapi_operation(..., messages = [...])] fail with a confusing, unactionable error instead of a clear diagnostic.
messages = [...] entries are parsed as syn::Path (asyncapi-rust-codegen/src/asyncapi_spec_attrs.rs:553), which only accepts Foo<Bar> in expression-ambiguous form, and the emitted #type_name::asyncapi_message_names() would need a turbofish to be valid anyway.
Repro
#[asyncapi_operation(name = "send", action = "send", channel = "chat", messages = [Option<Msg>])]
Actual: two errors, neither pointing at the real problem — comparison operators cannot be chained, followed by proc-macro derive produced unparsable tokens.
Expected: either a syn::Error rejecting non-generic-free paths with a message naming the unsupported type, or proper support by emitting <#type_name>::asyncapi_message_names().
Split out of the review on #17 as a non-blocking follow-up; the feature itself works for the non-generic case.
Generic types in
#[asyncapi_operation(..., messages = [...])]fail with a confusing, unactionable error instead of a clear diagnostic.messages = [...]entries are parsed assyn::Path(asyncapi-rust-codegen/src/asyncapi_spec_attrs.rs:553), which only acceptsFoo<Bar>in expression-ambiguous form, and the emitted#type_name::asyncapi_message_names()would need a turbofish to be valid anyway.Repro
#[asyncapi_operation(name = "send", action = "send", channel = "chat", messages = [Option<Msg>])]Actual: two errors, neither pointing at the real problem —
comparison operators cannot be chained, followed byproc-macro derive produced unparsable tokens.Expected: either a
syn::Errorrejecting non-generic-free paths with a message naming the unsupported type, or proper support by emitting<#type_name>::asyncapi_message_names().Split out of the review on #17 as a non-blocking follow-up; the feature itself works for the non-generic case.