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

Incorrect yaml anchors encoding #1333

Open
d-enk opened this issue Oct 3, 2024 · 1 comment
Open

Incorrect yaml anchors encoding #1333

d-enk opened this issue Oct 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working triage

Comments

@d-enk
Copy link

d-enk commented Oct 3, 2024

Describe the bug

<<: * not encoded

default: &default
  name: ''
  age: 0

person:
  *default

persons:
- <<: *default
  age: 1
- <<: *default
  name: John
- { age: 3, <<: *default }

What happened?

actual

{
   "default": {
      "name": "",
      "age": 0
   },
   "person": {
      "name": "",
      "age": 0
   },
   "persons": [
      {
         "<<": {
            "name": "",
            "age": 0
         },
         "age": 1
      },
      {
         "<<": {
            "name": "",
            "age": 0
         },
         "name": "John"
      },
      {
         "age": 3,
         "<<": {
            "name": "",
            "age": 0
         }
      }
   ]
}

expected

{
  "default": {
    "name": "",
    "age": 0
  },
  "person": {
    "name": "",
    "age": 0
  },
  "persons": [
    {
      "name": "",
      "age": 1
    },
    {
      "name": "John",
      "age": 0
    },
    {
      "age": 3,
      "name": ""
    }
  ]
}

System information

System:
OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
Browsers:
Chrome: 129.0.6668.89

Where did you encounter the bug?

Public app (it-tools.tech)

@d-enk d-enk added bug Something isn't working triage labels Oct 3, 2024
@lvluu
Copy link
Contributor

lvluu commented Oct 22, 2024

PR created #1359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants