Skip to content

src: be more forgiving parsing JSON as a string #417

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

Merged
merged 2 commits into from
May 13, 2021

Conversation

lance
Copy link
Member

@lance lance commented May 12, 2021

A simple string is considered valid JSON. However, our parsers do
not accept that unless the string has quotation marks. This commit
modifies the parser to look for strings declared as application/json
which do not begin with '[' '{' or '"' and surrounds them with
quotes.

Signed-off-by: Lance Ball [email protected]

Proposed Changes

Description

A simple string is considered valid JSON. However, our parsers do
not accept that unless the string has quotation marks. This commit
modifies the parser to look for strings declared as application/json
which do not begin with '[' '{' or '"' and surrounds them with
quotes.

Signed-off-by: Lance Ball <[email protected]>
@lance lance added type/fix A change that fixes something that is broken module/lib Related to the main source code labels May 12, 2021
@lance lance requested a review from a team May 12, 2021 22:03
@lance lance self-assigned this May 12, 2021
@lance lance merged commit db4be6b into cloudevents:main May 13, 2021
@lance lance deleted the lance/tweak-json-parsing branch May 13, 2021 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/lib Related to the main source code type/fix A change that fixes something that is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants