Skip to content

channel and operation description attributes are parsed then silently dropped from the generated spec #24

Description

@mlilback

description is accepted on #[asyncapi_channel(...)] and #[asyncapi_operation(...)], parsed into the meta structs, and then silently discarded — it never reaches the generated document.

Cause

ChannelMeta.description (asyncapi-rust-codegen/src/asyncapi_spec_attrs.rs:70) and OperationMeta.description (:92) are both populated by their parsers, but the corresponding models have no field to hold it:

  • Channel (asyncapi-rust-models/src/lib.rs:336) has only address, messages, parameters
  • Operation (:597) has only action, channel, messages, bindings

so the codegen at asyncapi-rust-codegen/src/lib.rs:977 and :1132 never emits it.

Repro

#[derive(AsyncApi)]
#[asyncapi(title = "Probe", version = "1.0.0")]
#[asyncapi_channel(name = "chat", address = "/chat", description = "CHANNEL DESC")]
#[asyncapi_operation(name = "send", action = "send", channel = "chat", description = "OP DESC", messages = [Msg])]
pub struct Api;

Neither string appears anywhere in Api::asyncapi_spec(). No warning, no error.

Expected

Both should emit description on the respective object — AsyncAPI 3.0 allows it on both the Channel Object and the Operation Object.

Note the attribute is not currently listed in the documented attributes for either macro, so this is a silently-ignored input rather than a documented feature that regressed. Rejecting it would also be defensible, but emitting it is clearly the intent given the parsers already collect 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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions