[ 
https://issues.apache.org/jira/browse/CAMEL-10969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16178142#comment-16178142
 ] 

Claus Ibsen commented on CAMEL-10969:
-------------------------------------

There is a branch here
https://github.com/apache/camel/tree/json-simple

And you can turn on|off prettyPrint mode on the camel-connector-maven-plugin 
(default on)
https://github.com/apache/camel/blob/json-simple/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java#L81

And you have json in pretty print such as (its hardcoded to use tab in 
json-simple so we cannot change to use 2 spaces etc)
https://github.com/apache/camel/blob/json-simple/connectors/examples/foo-connector/src/main/resources/camel-connector-schema.json

The API is the same as before, you just use JSonSchemaHelper from camel-catalog
https://github.com/apache/camel/blob/json-simple/platforms/camel-catalog/src/main/java/org/apache/camel/catalog/JSonSchemaHelper.java#L42

... which now supports:

old single-line mode
pretty printed mode
or any json mode (assuming the parser works well)

> JSonSchemaHelper - Json parser should we use json-simple instead
> ----------------------------------------------------------------
>
>                 Key: CAMEL-10969
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10969
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.20.0
>
>
> We use our own json parser in JSonSchemaHelper in different places as part of 
> the catalog stuff we have done over the last 3-4 years. And as it has 
> expanded to be used in more places than just as in the beginning in apt, we 
> are duplicating some of that code around.
> We could consider shading in json-simple in camel-core and camel-catalog.
> And where its used in apt, maven plugins and elsewhere.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to