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

[Bug]: json.indent() omits returning objects with a key = "class" #5190

Closed
Baaaaaz opened this issue Feb 7, 2025 · 1 comment · Fixed by #5217
Closed

[Bug]: json.indent() omits returning objects with a key = "class" #5190

Baaaaaz opened this issue Feb 7, 2025 · 1 comment · Fixed by #5217
Assignees
Labels

Comments

@Baaaaaz
Copy link

Baaaaaz commented Feb 7, 2025

Describe the Bug

The json.indent() function has an issue with json objects keys called "class" (in lowercase) and omits them from the returned value.

To Reproduce

Add the following to a new macro, run and observe results.

[r: vJson = json.set("{}", "class", "not so classy", "CLASS", "but this is")]
[r: "<pre>" + json.indent(vJson) + "</pre>"]

Expected Behaviour

json.indent() function does not omit anyhting.

Screenshots

Image

MapTool Info

No response

Desktop

No response

Additional Context

Originally noticed here: https://discord.com/channels/296230822262865920/1334553385440907374/1337233348803956808

@Baaaaaz Baaaaaz added the bug label Feb 7, 2025
@kwvanderlinde
Copy link
Collaborator

kwvanderlinde commented Feb 13, 2025

Fixed by accident in #5217.

Provided macro now prints:

{"class":"not so classy","CLASS":"but this is"}
{
  "class": "not so classy",
  "CLASS": "but this is"
}

@kwvanderlinde kwvanderlinde self-assigned this Feb 13, 2025
@kwvanderlinde kwvanderlinde linked a pull request Feb 13, 2025 that will close this issue
@kwvanderlinde kwvanderlinde moved this from Todo to Merged in MapTool 1.17 Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging a pull request may close this issue.

2 participants