-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Hook up json_strict option with default of true #6909
Conversation
plugins/parsers/json/README.md
Outdated
@@ -20,7 +20,7 @@ ignored unless specified in the `tag_key` or `json_string_fields` options. | |||
|
|||
## When strict is true and a JSON array is being parsed, all objects within the | |||
## array must be valid | |||
strict = false | |||
strict = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this need to be named json_strict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks.
@@ -1411,7 +1411,9 @@ func buildParser(name string, tbl *ast.Table) (parsers.Parser, error) { | |||
} | |||
|
|||
func getParserConfig(name string, tbl *ast.Table) (*parsers.Config, error) { | |||
c := &parsers.Config{} | |||
c := &parsers.Config{ | |||
JSONStrict: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @rawkode intended to have it default false to fix #6532, see #6532 (comment) Won't default true cause a regression there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regression is in 1.13.0 because we changed the parse behavior, I disagree that this should parse be accepted by default because it has the non-obvious behavior of discarding the object.
(cherry picked from commit c6519c7)
closes: #6906
Required for all PRs: