Conversation
…2 typo
Four subscription payloads write the q string as
"q": "filling>0.6;filling<0.8;controlledAsset==%22urn:ngsi-ld:Building:farm001%22"
%22 is a percent-encoded double quote. Percent-decoding belongs to the URL
layer, and this q is in a request BODY, where nothing decodes it - so the value
seen by the broker is literally %22urn:ngsi-ld:Building:farm001%22, which is
neither a quoted string nor a URI. A broker that validates the q grammar
rejects it with 400.
Replaced with JSON-escaped quotes, which is what the clause asks for and parses
identically everywhere:
"q": "filling>0.6;filling<0.8;controlledAsset==\"urn:ngsi-ld:Building:farm001\""
All five payloads on the page still parse as valid JSON.
Also: 'x-nsgiv2-keyValues' and 'x-nsgiv2-keyValues-compacted' in the custom
format list are misspellings of x-ngsiv2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four subscription payloads write the
qstring as:%22is a percent-encoded double quote. Percent-decoding belongs to the URL layer, and thisqis in a request body, where nothing decodes it — so the value the broker receives is literally%22urn:ngsi-ld:Building:farm001%22, which is neither a quoted string nor a URI.A broker that validates the q grammar rejects the subscription outright:
So the three subscriptions this section creates are never created, and the notification examples that follow cannot fire.
The change
JSON-escaped quotes, which is what § 4.9 asks for and parses identically everywhere:
All five payloads on the page still parse as valid JSON (checked).
Also
x-nsgiv2-keyValuesandx-nsgiv2-keyValues-compactedin the custom-format list are misspellings ofx-ngsiv2.Found while running all sixteen NGSI-LD tutorials against a different NGSI-LD broker. Note this may not reproduce on a broker that percent-decodes
qin bodies, which is presumably why it went unnoticed.