Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Support Comments in JSON configuration files #187

Closed
ltnd opened this issue Sep 5, 2017 · 2 comments
Closed

Support Comments in JSON configuration files #187

ltnd opened this issue Sep 5, 2017 · 2 comments
Assignees
Milestone

Comments

@ltnd
Copy link

ltnd commented Sep 5, 2017

Could it be possible for ml-gradle to allow comments in FasterXML parser (ALLOW_COMMENTS) so we can deactivate a config in a JSON file instead of having to delete the part ?
Example :
{
  "database-name" : "%%DATABASE%%",
  "range-element-index" : [ /*{
    "scalar-type" : "int",
    "namespace-uri" : null,
    "localname" : "id",
    "collation" : null,
    "range-value-positions" : false,
    "invalid-values" : "ignore"
  } */]
}

@rjrudin rjrudin added this to the 3.1.0 milestone Oct 6, 2017
@rjrudin
Copy link
Contributor

rjrudin commented Oct 6, 2017

Yes, I'll try to include this 3.1.0, which will be released within a couple weeks or so.

@rjrudin rjrudin self-assigned this Oct 30, 2017
@rjrudin
Copy link
Contributor

rjrudin commented Oct 30, 2017

Doing two things to support this:

  1. Consolidating all instantiations of ObjectMapper into a static ObjectMapperFactory class which enables the Jackson "allow comments" feature
  2. Modifying ManageClient so that it can optionally "clean" JSON payloads by reading them into a JsonNode and then writing them back out to a String, which ensures any comments that are ignored are then removed.

Since there's a little cost to that "cleaning" of JSON, this behavior will be disabled by default. A new property - mlManageCleanJsonPayloads - will allow for the behavior to be enabled.

rjrudin added a commit that referenced this issue Oct 30, 2017
rjrudin added a commit that referenced this issue Oct 30, 2017
rjrudin added a commit that referenced this issue Nov 1, 2017
@rjrudin rjrudin closed this as completed Nov 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants