Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of dictionaries not indented correctly #130

Open
LBsh opened this issue Jul 23, 2020 · 0 comments
Open

List of dictionaries not indented correctly #130

LBsh opened this issue Jul 23, 2020 · 0 comments

Comments

@LBsh
Copy link

LBsh commented Jul 23, 2020

version: 0.13.0

command:

val json = io.circe.jawn.parse("""{"foo":[{"abc": "barasdfasdfasdf", "cs": "barasdfasdfasdf", "abcas": "barasdfasdfasdf", "absb": "barasdfasdfasdf"}], "bar": {"a": 1}}""").valueOr(throw _)
io.circe.yaml.Printer(indicatorIndent = 2).pretty(json)

expected:

"foo:
  - abc: barasdfasdfasdf
    cs: barasdfasdfasdf
    abcas: barasdfasdfasdf
    absb: barasdfasdfasdf
bar:
  a: 1
"

actual:

"foo:
  -
  abc: barasdfasdfasdf
  cs: barasdfasdfasdf
  abcas: barasdfasdfasdf
  absb: barasdfasdfasdf
bar:
  a: 1
"

If I change indent from 2 to 4:

new command:

val json = io.circe.jawn.parse("""{"foo":[{"abc": "barasdfasdfasdf", "cs": "barasdfasdfasdf", "abcas": "barasdfasdfasdf", "absb": "barasdfasdfasdf"}], "bar": {"a": 1}}""").valueOr(throw _)
io.circe.yaml.Printer(dropNullKeys = true, indicatorIndent = 2, indent=4).pretty(json)

then it becomes:

"foo:
  - abc: barasdfasdfasdf
    cs: barasdfasdfasdf
    abcas: barasdfasdfasdf
    absb: barasdfasdfasdf
bar:
    a: 1
"

Is there ways that I can have strictly 2 indentation spaces for all?

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 a pull request may close this issue.

1 participant