Repository navigation
fix: make mixed CRUD method directives order-independent - #867
Merged
TommyLemon merged 1 commit into
APIJSON:master from
014-code:codex/fix-809-mixed-crud-method-order
Jul 28, 2026
Merged
Conversation
Copy link
Copy Markdown
Contributor
Summary
Fixes #809 .
Mixed CRUD requests containing @post, @put, or @delete could be parsed incorrectly depending on the order of fields in the JSON object.
For example, when a business object appeared before its @delete directive, the object could fall back to GET or use the method assigned to a related array entry.
Root Cause
AbstractParser.batchVerify collected method directives and processed business objects in the same loop.
Therefore, a directive only affected objects appearing after it in iteration order.
Changes
- Pre-scan all supported method directives before processing business objects
- Make mixed CRUD method dispatch independent of JSON field order
- Preserve the priority of an object's explicit
@method
- Keep method directive values limited to String or JSONObject
- Add documentation for deleting and batch inserting into the same table
- Add regression tests for method ordering, priority, and invalid array values
Verification
mvn -q -f APIJSONORM/pom.xml test
- Tests run: 3
- Failures: 0
- Errors: 0
git diff --check passed
fix: make mixed CRUD method directives order-independent APIJSON#809
c01a4e5
Copy link
Copy Markdown
Member
|
Good, thank you contribute again~
This PR is a little bit big, so I need some time to review and test the change.
|
TommyLemon
merged commit
2ea3700
into
APIJSON : master
Jul 28, 2026
1 check passed
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment
Labels
None yet
2 participants