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

Stephen Olander-Waters commented on GROOVY-7527:
------------------------------------------------

Thanks, with your code:
{code}
            configOpts = jsonSlurper.setType(JsonParserType.LAX).parse(new 
File(CONFIG_FILE))
{code}

I'm now getting: 

{code}
Exception in thread "main" Not that kind of map
groovy.json.internal.Exceptions$JsonInternalException: Not that kind of map
        at groovy.json.internal.Exceptions.die(Exceptions.java:37)
        at groovy.json.internal.LazyValueMap.put(LazyValueMap.java:186)
        at groovy.json.internal.LazyValueMap.put(LazyValueMap.java:45)
        at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2710)
        at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3749)
        at 
org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:199)
        at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:484)
        at PrintToBox.main(PrintToBox.groovy:90)
{code}

> Either support JavaScript comments in JsonSlurper or fix documentation
> ----------------------------------------------------------------------
>
>                 Key: GROOVY-7527
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7527
>             Project: Groovy
>          Issue Type: Bug
>          Components: JSON
>    Affects Versions: 2.4.3, 2.4.4
>         Environment: Linux
> OpenJDK 7
>            Reporter: Stephen Olander-Waters
>            Assignee: Guillaume Laforge
>            Priority: Minor
>              Labels: json, jsonslurper
>
> This page says that JsonSlurper supports parsing JavaScript comments:
> http://www.groovy-lang.org/json.html
> However, this does not parse:
> {code:javascript}
> {
>     "enterpriseDomain": "@example.com"
>     ,"clientId": "abcdefghijklmnopqrstuvwxyz123456"
>     ,"clientSecret": "abcdefghijklmnopqrstuvwxyz123456"
> }
>     /*  Optional parameters with defaults shown */
>     /* ,"tokensLockRetries": 1000               */
>     /* ,"baseFolderName": "MyFolder"          */
> {code}
> Please fix JsonSlurper (yay!) or the documentation (I has a sad!).
> Thank you!!! :)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to