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

JSON_Validate() return JSONIllegalDocument on valid JSON #168

Closed
vasilchenkosv opened this issue Jul 18, 2024 · 2 comments
Closed

JSON_Validate() return JSONIllegalDocument on valid JSON #168

vasilchenkosv opened this issue Jul 18, 2024 · 2 comments

Comments

@vasilchenkosv
Copy link

vasilchenkosv commented Jul 18, 2024

JSON_Validate() return JSONIllegalDocument for valid JSON document.

const char* json = "{\"obj\":{}}";
JSONStatus_t result = JSON_Validate(json, strlen(json));
@moninom1
Copy link
Member

moninom1 commented Jul 18, 2024

Hi @vasilchenkosv

Thank you for raising the bug. Yes it seems like incorrect value [JSONIllegalDocument] is returned for this example.
We will look into the problem and possible solutions internally, meanwhile if you have a quick solution for the issue, You can also contribute by raising a PR.

aggarg added a commit to aggarg/coreJSON that referenced this issue Jul 18, 2024
Without this change, the following valid JSON document will be evaluated
as invalid:
```
{
    "foo": {}
}
```

This issue was reported here - FreeRTOS#168

Signed-off-by: Gaurav Aggarwal <[email protected]>
aggarg added a commit that referenced this issue Jul 20, 2024
Treat empty JSON object in key-value pair as valid

Without this change, the following valid JSON document will be evaluated
as invalid:
```
{
    "foo": {}
}
```

This issue was reported here - #168

Signed-off-by: Gaurav Aggarwal <[email protected]>
@moninom1
Copy link
Member

Hi @vasilchenkosv , Closing the issue as the fix has been merged. Thank you

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

No branches or pull requests

2 participants