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

remove "data" property from JSON Datatype #79

Open
alexzrp opened this issue Mar 8, 2023 · 3 comments
Open

remove "data" property from JSON Datatype #79

alexzrp opened this issue Mar 8, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@alexzrp
Copy link

alexzrp commented Mar 8, 2023

To reproduce:

  1. Create a collection with JSON field
  2. Insert in JSON field the content: [{"data": 1}, {"data": "test"}]
  3. Transform remove "data" from JSON content.

This isn't a relation field.

@alexzrp
Copy link
Author

alexzrp commented Mar 8, 2023

the same occour if in content exist "attributes" and flag removeAttribute is true

@ComfortablyCoding
Copy link
Contributor

Thanks for submitting this issue! I assume it is a fairly small use case as this is the first report for this issue but I will look into it. Not an intended behaviour.

@ComfortablyCoding ComfortablyCoding added the bug Something isn't working label Mar 9, 2023
@sven-ra
Copy link

sven-ra commented Jun 6, 2023

Running into the same issue here. I am using JSON field to generate charts.

An example chart JSON looks like this:

{
  "labels": [
    "Red",
    "Blue",
    "Yellow",
    "Green",
    "Purple",
    "Orange"
  ],
  "datasets": [
    {
      "label": "# of Votes",
      "data": [
        12,
        19,
        3,
        5,
        2,
        3
      ],
      "backgroundColor": [
        "rgba(255, 99, 132, 0.2)",
        "rgba(54, 162, 235, 0.2)",
        "rgba(255, 206, 86, 0.2)",
        "rgba(75, 192, 192, 0.2)",
        "rgba(153, 102, 255, 0.2)",
        "rgba(255, 159, 64, 0.2)"
      ],
      "borderColor": [
        "rgba(255, 99, 132, 1)",
        "rgba(54, 162, 235, 1)",
        "rgba(255, 206, 86, 1)",
        "rgba(75, 192, 192, 1)",
        "rgba(153, 102, 255, 1)",
        "rgba(255, 159, 64, 1)"
      ],
      "borderWidth": 1
    }
  ]
}

And the API output looks like this:

{
  "labels": [
    "Red",
    "Blue",
    "Yellow",
    "Green",
    "Purple",
    "Orange"
  ],
  "datasets": [
    [
      12,
      19,
      3,
      5,
      2,
      3
    ]
  ]
}

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

No branches or pull requests

3 participants