Skip to content

exclude synthetic and ignored fields from json field filtering - #1308

Merged
robertlazarski merged 1 commit into
apache:masterfrom
kali834x:field-filter-synthetic-ignored
Oct 11, 2026
Merged

robertlazarski merged 1 commit into
apache:masterfrom
kali834x:field-filter-synthetic-ignored

Conversation

@kali834x

@kali834x kali834x commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

the ?fields= selector parsed by FieldFilteringMessageFormatter comes straight off the request query string, but getAllFields in JSONStreamingMessageFormatter and MoshiStreamingMessageFormatter only dropped static and transient fields before reflecting with setAccessible. naming a field the backend never serializes widens the response instead of narrowing it: this$0 on a non-static inner result class serializes the whole enclosing instance, and a moshi @JSON(ignore = true) field becomes readable by name even though the unfiltered response omits it. skip synthetic fields in both getAllFields implementations and honor @JSON(ignore) in the moshi one, so the filter can only select from what the unfiltered output already contains. added regression tests in the shared filter test base (runs against both delegates) and the moshi formatter test; all three fail before the change, and the full axis2-json suite passes after.

@robertlazarski
robertlazarski merged commit 9888878 into apache:master Oct 11, 2026
5 checks passed
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.

2 participants