Skip to content

Give the exact error text for a JSON Builder with no sequence number - #139

Merged
jwrosewell merged 2 commits into
rcfrom
doc/json-builder-sequence-message
Nov 11, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
doc/json-builder-sequence-message

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

James Rosewell's rule for the 11 November 2026 release is "The point of the release is consistency." The error a JSON Builder gives when no Sequence Element has produced a sequence number reads differently in every language that gives one.

Language What the error says on rc
.NET "The value for the 'sequence' parameter could not be found. See <documentation link> for more information." (Messages.resx lines 120 to 122)
Java "Make sure there is a SequenceElement placed before this JsonBuilderElement in the pipeline", with the cause "Sequence number not present in evidence. this is mandatory." (JsonBuilderElement.java lines 206 to 229)
Node "There is no sequence number. A Sequence Element needs to be placed before the JSON Builder Element in the Pipeline." (jsonbundler.js lines 73 and 74)
PHP "The JSON Bundler needs a sequence number from the Sequence Element. Place a Sequence Element before the JSON Bundler in the Pipeline." (Messages.php line 53)
Python "The JSON Builder needs the sequence number that a Sequence Element produces. A Sequence Element needs to be placed before it in the Pipeline." (jsonbundler.py lines 110 to 113)
Go "the JSON Builder Element found no sequence number, so a Sequence Element needs to be placed before it in the Pipeline" (jsonbuilder.go lines 109 to 111)
Rust No error. The JSON is built with a sequence number of 0. 51degrees-rust#383 adds the error.

What the specification said

json-builder.md at 67ead698, lines 120 to 124:

If no Sequence Element has produced a sequence number when the Element runs, the Element MUST fail with an error and MUST NOT set its JSON value. The error SHOULD say that a Sequence Element needs to be placed before the JSON Builder Element in the Pipeline.

A SHOULD about what the error says left each language free to choose its own words, which is how six languages came to give six different messages.

What changed

json-builder.md at the head of this draft, section "Sequence number", in the same form as the Errors table in data-updates.md.

  1. The SHOULD becomes a MUST. The error MUST carry the message in a one row table, "The JSON Builder needs a sequence number. Place a Sequence Element before the JSON Builder in the Pipeline.", which is the text every implementation gives.
  2. PHP names this Element the JSON Bundler, so PHP gives "The JSON Bundler needs a sequence number. Place a Sequence Element before the JSON Bundler in the Pipeline." Nothing else differs.
  3. Where an implementation wraps the error in another, such as a Pipeline Configuration Exception that carries the first error as its cause, the error the caller reads carries the message.
  4. The message is the whole text of the error, and an implementation MUST NOT add anything to it, such as a link to documentation. A prefix that a language's error type writes in front of every error of that type when the error is shown, such as the type's name, is not part of the message. So the documentation link at the end of .NET's message goes, which 51degrees-dotnet#135 does, and the "pipeline configuration error: " that every Go ConfigurationError writes in front of its message stays (errors.go lines 45 to 50). The second commit, 2285798, adds this item, because the first left open whether anything could follow the message.

The rest of the section is unchanged, including the paragraph on query.sequence text from a query string.

The language drafts that give this text

Checks

The repository has no pull request build. Both of its pull request checks passed on the head, 2285798:

What remains

Nothing in this draft. The language drafts above wait for this one, because each cites the text it states.

Every implementation gives the same message when no Sequence Element has produced a sequence number, with JSON Bundler in place of JSON Builder in PHP. Where the error is wrapped, the error the caller reads carries the message.
Nothing is added to the message, such as a documentation link. A prefix that a language's error type writes in front of every error of that type is not part of the message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant