Skip to content

Feature Flags for Json Patch and XML - #1645

Open
suarezrominajulieta wants to merge 6 commits into
masterfrom
feature/jsonPatch_xml_featureFlags_new
Open

Feature Flags for Json Patch and XML#1645
suarezrominajulieta wants to merge 6 commits into
masterfrom
feature/jsonPatch_xml_featureFlags_new

Conversation

@suarezrominajulieta

Copy link
Copy Markdown
Collaborator

We create this pr to introduce 2 keys to compare coverage of endpoints with and without json patch and xml support.

@suarezrominajulieta
suarezrominajulieta marked this pull request as ready for review July 26, 2026 23:41
@jgaleotti
jgaleotti requested a review from arcuri82 July 28, 2026 13:50

val inferFormatFromNames: Boolean = true,

val disableJsonPatchSupport: Boolean = false,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

property should be in "positive" sense, not negative. ie, this should be renamed into jsonPatchSupport, and its semantics flipped, ie, i guess default true here


val disableJsonPatchSupport: Boolean = false,

val disableXMLSupport: Boolean = false,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

see previous comment. this should be renamed xmlSupport, with semantics flipped


val isJsonPatch = verb == HttpVerb.PATCH && bodies.keys.any { it.contains("json-patch") }
val isJsonPatch = !options.disableJsonPatchSupport &&
verb == HttpVerb.PATCH && bodies.keys.any { it.contains("json-patch") }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should check for ignoring case of "json-patch"

@Experimental
@Cfg("Disable JSON Patch (RFC 6902) gene support when the request Content-Type is 'application/json-patch+json'." +
" When true, such endpoints are treated as regular JSON bodies, reproducing the behavior before this feature was introduced.")
var disableJsonPatchSupport = false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should be renamed enableJsonPatchSupport.
also, experimental options should not be on by default.
once we run experiments, and we are happy with them, we put them on by default, and remove the tag Experimental

@Experimental
@Cfg("Disable XML-aware field naming for body genes when the request Content-Type is XML." +
" When true, body gene names fall back to the pre-feature behavior (schema ref name or 'body').")
var disableXMLSupport = false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

rename enableXmlSupport, and of course update documentation due to flipped semantics

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.

3 participants