[ 
https://issues.apache.org/jira/browse/GROOVY-11200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17823263#comment-17823263
 ] 

Pablo Pazos edited comment on GROOVY-11200 at 3/4/24 5:21 PM:
--------------------------------------------------------------

This is an issue on Groovy 3.x too, would the solution be backported?


For instance, this will parse OK:

{noformat}
// Note there is no closing curly brace
def t = "{"
def json_parser = new JsonSlurper()
json_parser.parseText(t)
{noformat}

[~paulk]


was (Author: ppazos):
This is an issue on Groovy 3.x too, would the solution be backported?

 

For instance, this will parse OK:

 
{noformat}
// Note there is no closing curly brace
def t = "{"
def json_parser = new JsonSlurper()
json_parser.parseText(t){noformat}

> JsonSlurper parses badly format JSON without throwing exception
> ---------------------------------------------------------------
>
>                 Key: GROOVY-11200
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11200
>             Project: Groovy
>          Issue Type: Bug
>          Components: JSON
>    Affects Versions: 4.0.14
>            Reporter: John Yin
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 5.0.0-alpha-4, 4.0.17
>
>
> JsonSlurper should throw a JsonException when parsing the following input:
> {code:json}
> """
> {
>    "a":1,
>    "b": {
>         "c":2
>     }"""
> {code}
>  
> But it parses the string successfully.  On the other hand, it does throw a 
> JsonException when parsing
>  
> {code:json}
> """
> {
>    "a":1,
>    "b": {
>         "c":2
>     }
> """
> {code}
> where the ending """ is on a separate line.
>  
> I think it should fail for both.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to