Skip to content

More thorough determination of JSON#10379

Merged
nielsm5 merged 3 commits intomasterfrom
issue/10352_ImproveTestingForJson
Feb 3, 2026
Merged

More thorough determination of JSON#10379
nielsm5 merged 3 commits intomasterfrom
issue/10352_ImproveTestingForJson

Conversation

@tnleeuw
Copy link
Contributor

@tnleeuw tnleeuw commented Feb 2, 2026

Changes

Pull Request Checklist

Title

  • Title expresses the business value (who benefits + what outcome)

Issues

Backports

  • Backport PRs created (if needed) and linked

Documentation

  • FF! Doc updated (user-facing behavior/config)
  • FF! Manual updated (if applicable)
  • Javadoc updated/generated (developer-facing APIs)

Tests

  • Unit tests added/updated
  • E2E/Integration tests added/updated (if applicable)

Breaking changes

  • Breaking change recorded in markdown file
  • Migration notes included (if needed)

@tnleeuw tnleeuw requested review from evandongen and nielsm5 February 2, 2026 22:29
@tnleeuw tnleeuw self-assigned this Feb 2, 2026
…tter JSON parsing doesn't mislabel the input as text.
@@ -366,18 +367,26 @@ private static MimeType guessMimeType(Message message) {
}
try (InputStream inputStream = message.asInputStream()) {
try (JsonParser parser = Json.createParser(inputStream)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gaat dit echt goed joh? Als ik dit zo lees, parse je een inputStream en als dat json is, of hij er geen json van kan maken, return dan APPLICATION_JSON - of wordt er dan geen NoSuchElementException gegooid? Ik vind het niet heel duidelijk zo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Als het geen JSON is dan komt hij bij een ParseException en geeft hij TEXT terug.
Ik zal nog eens naar de code kijken of ik het duidelijker kan maken maar ik probeer te parsen zonder direct een hele JSON in memory te houden, vandaar dat ik de parse-events weggooi en niet een meer high-level parser gebruik.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully the new version I pushed it clearer; I removed the NoSuchElementException because realistically it cannot happen anymore now that I check hasNext() in the while condition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this reads a lot better

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2026

@nielsm5 nielsm5 merged commit cd6ca5a into master Feb 3, 2026
22 checks passed
@nielsm5 nielsm5 deleted the issue/10352_ImproveTestingForJson branch February 3, 2026 11:42
tnleeuw added a commit that referenced this pull request Feb 4, 2026
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.

DataSonnetPipe throws "Unrecognized token '$'" when jsonInputValidator 'failureReason' sessionKey is the input

3 participants