You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sounds good, as per discussion. Aside from CLA (thanks for the email explaining the situation), would it be possible to add same change for jakarta-jsonp module? Due to awkward relationship between "old" JAXP and new "Jakarta", there are 2 modules which are almost identical, save for dependency to one API version or the other.
Another question is whether JsonPatchDeserializer might need changes too.
Thanks! I've applied the same changes for JSON Merge Patch in the jakarta-jsonp module.
Indeed, also JsonPatchDeserializer throws several different types of exceptions when the input is not an array, including an NPE. However, the situation is somewhat different: the relevant RFC explicitly states that a JSON Patch is an array of objects (Section 3, first sentence). Section 5 of the same says that evaluation of the patch should terminate if the a normative requirement is violated (emphasis mine). Indeed, the Glassfish implementation of JsonPatch#apply checks whether all elements are objects.
Consequently, I think it is sufficient for Jackson to check whether the input is an array and there's no need to iterate over its elements (that's the job of JsonPatch#apply). In case the input is not an array, we should throw an exception; I think InvalidFormatException is the appropriate one.
I've updated the PR for JsonPatch, but only in the jsr-353 module for now (I'll update the jakarta-jsonp once jsr-353 is stable).
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
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.
Fix for #27