jackson-dataformats-text icon indicating copy to clipboard operation
jackson-dataformats-text copied to clipboard

Option to use square brackets for arrays instead of dash

Open sscarduzio opened this issue 6 years ago • 5 comments

Hi, is there a way to get this:

    kibana_hide_apps: ["readonlyrest_kbn", "timelion"]

instead of this:

    kibana_hide_apps:
    - "readonlyrest_kbn"
    - "timelion"

sscarduzio avatar Oct 17 '17 15:10 sscarduzio

I assume this is for YAML backend. At this point I don't think there is no YAMLFeature for this, although I think SnakeYAML (which is underlying decoder/encoder) should be able to do that -- it is difference between "inline" vs "block" notation I think.

It would probably make sense to allow selecting this just for arrays (and perhaps another one for Objects), if adding a new feature.

Another possibility would be to allow somehow passing specifically configured SnakeYAML emitter/parser, as this would expose full range of settings.

cowtowncoder avatar Oct 17 '17 21:10 cowtowncoder

If anyone knows configuration within SnakeYAML, I'd be interested in figuring out how to pass this configuration.

cowtowncoder avatar Nov 30 '17 02:11 cowtowncoder

Is this what you are looking for ? FlowStyle.BLOCK, FlowStyle.FLOW, FlowStyle.AUTO

AUTO means that the first will be block style and then flow style.

asomov avatar Mar 08 '18 10:03 asomov

Thank you @asomov. That helps understanding intent between styles.

Can this be changed during generation, or does the initial setting remain in effect when generation starts?

cowtowncoder avatar Mar 08 '18 20:03 cowtowncoder

it remains

asomov avatar Mar 08 '18 21:03 asomov