Skip to content

[NATS binding] Structured-mode Content-Type detection imprecise #1398

Description

@RAnders00

While reviewing the current NATS protocol binding (1.0.3-wip), I noticed a possible ambiguity in structured-mode detection:

Section 3 of the NATS binding states:

If the server is version 2.2 or above and the Content-Type header of application/cloudevents is present (matched case-insensitively), then the message is in structured mode, otherwise it is using binary mode.

However, Section 3 of the JSON event format states:

Such a representation MUST use the media type application/cloudevents+json.

With an exact comparison, a message carrying Content-Type: application/cloudevents+json would therefore be classified as binary rather than structured.

The HTTP binding explicitly describes application/cloudevents as a prefix for mode detection.

Since I imagine the NATS binding's intent is to have a prefix (like the HTTP binding), I suggest changing the wording to reflect that.

Links

The NATS detection rule was introduced in PR #1016. The JSON format already required application/cloudevents+json before that change.

Activity

  1. added 7 commits that reference this issue on Oct 6, 2026
    3920c1f
    c7165ad
    bb74689
    28e865f
    721b488
    e9fb879
    49337f2
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions