You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Ramesh Venkitaswaran (Jira)" <ji...@apache.org> on 2025/08/31 20:30:00 UTC
[jira] [Created] (GROOVY-11748) Groovy JsonSlurper returns null
Ramesh Venkitaswaran created GROOVY-11748:
---------------------------------------------
Summary: Groovy JsonSlurper returns null
Key: GROOVY-11748
URL: https://issues.apache.org/jira/browse/GROOVY-11748
Project: Groovy
Issue Type: Bug
Affects Versions: 5.0.0
Reporter: Ramesh Venkitaswaran
When I run my test script against Groovy 5.0.0, this returns null, whereas the same script runs correctly against Groovy 4.0.28
{code:groovy}
import groovy.json.*
def url = 'https://api.weather.gov/gridpoints/TOP/31,80/forecast'
def response = new URL(url).text
def weather = new JsonSlurper().parseText(response)
assert weather.properties.periods != null
{code}
In 5.0.0, this returns (partially reproduced), whereas in 4.0.28 it correctly returns the map of the parsed json.
{noformat}
Exception thrown
Assertion failed:
assert weather.properties.periods != null
| | | |
| | null false
| ['JDK_MAP_ALTHASHING_SYSPROP':null, 'map':null, 'size':4, 'keys':['@context', 'type', 'geometry', 'properties', null], 'values':[['https://geojson.org/geojson-ld/geojson-context.jsonld', ['@version':'1.1',
{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)