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

added check for integer being key in object #63

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

andsmi97
Copy link
Contributor

@andsmi97 andsmi97 commented Aug 8, 2024

previous behaviour:
data = '{42:{"key":"value", "key2":"value2"}}'

repair_json(data) -> '{"key":"value", "key2":"value2"}'

new behaviour:
repair_json(data) -> '{"42":{"key":"value", "key2":"value2"}}'

Issue #


bugfix

What is the current behavior?

Currently repair_json fixes missing quotes only for alpha keys, however alphanumeric are also valid keys

What is the new behavior?

repair_json also fixes alphanumeric keys missing quotes

Does this introduce a breaking change?

  • Yes
  • No

Other information

previous behaviour:
data = '{42:{"key":"value", "key2":"value2"}}'

repair_json(data) -> '{"key":"value", "key2":"value2"}'

new behaviour:
repair_json(data) -> '{"42":{"key":"value", "key2":"value2"}}'
@mangiucugna
Copy link
Owner

Hi, thanks for submitting. Before I review, this library uses TDD, so any change must have new tests added as well.
Please add the appropriate tests for this change and I’ll take a look later this week

Cheers

added test for changing alphanumeric
@andsmi97
Copy link
Contributor Author

andsmi97 commented Aug 8, 2024

Added test that checks for new behavior. This test also should fail for old behaviour

@mangiucugna mangiucugna merged commit 86ca029 into mangiucugna:main Aug 8, 2024
6 checks passed
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 this pull request may close these issues.

2 participants