Skip to content

vendor-extensions.md writes into the init-only, null-by-default Extensions #61

Description

@nficano

Category: docs Severity: major
Location: docs/guides/vendor-extensions.md:33-36

What

Envelope.Extensions is IDictionary<string,JsonElement>? with an init-only setter (src/Arcp.Core/Envelope/Envelope.cs:62). On a freshly constructed Envelope it is null, so the indexer assignment throws NullReferenceException at runtime; it also cannot be reassigned after construction.

Evidence

var env = new Envelope { /* ... */ };
env.Extensions["x-vendor.acme.priority"] = JsonSerializer.SerializeToElement("high");
await transport.SendAsync(env, ct);

Proposed fix

Set Extensions in the object initializer, e.g. new Envelope { ..., Extensions = new Dictionary<string, JsonElement> { ["x-vendor.acme.priority"] = ... } }.

Acceptance criteria

  • The example populates Extensions via the init-only property without dereferencing null.

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

    audit/docsAudit: documentation inaccuracysev/majorSeverity: major

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions