Skip to content
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

JsonParser is not working with Records #918

Open
pushpanktugnawat opened this issue Apr 25, 2023 · 2 comments
Open

JsonParser is not working with Records #918

pushpanktugnawat opened this issue Apr 25, 2023 · 2 comments

Comments

@pushpanktugnawat
Copy link

Hey Team,

I am facing a problem accessing a records object with jsonpath. And I can see some error is happening with Jsonparser beneth.

Please find stacktrace for more info and help me with it.

at net.minidev.json.writer.BeansMapper$Bean.createObject(BeansMapper.java:93)
	at net.minidev.json.parser.JSONParserBase.readObject(JSONParserBase.java:559)
	at net.minidev.json.parser.JSONParserBase.readFirst(JSONParserBase.java:363)
	at net.minidev.json.parser.JSONParserBase.parse(JSONParserBase.java:216)
	at net.minidev.json.parser.JSONParserString.parse(JSONParserString.java:58)
	at net.minidev.json.parser.JSONParser.parse(JSONParser.java:278)
	at net.minidev.json.JSONValue.parse(JSONValue.java:201)
	at com.jayway.jsonpath.spi.mapper.JsonSmartMappingProvider.map(JsonSmartMappingProvider.java:85)
	at com.jayway.jsonpath.internal.JsonContext.convert(JsonContext.java:117)
	at com.jayway.jsonpath.internal.JsonContext.read(JsonContext.java:82)
	at org.springframework.test.util.JsonPathExpectationsHelper.evaluateJsonPath(JsonPathExpectationsHelper.java:318)
	... 83 more
@SingingBush
Copy link
Contributor

The issue is in json-smart, it doesn't support Records: netplex/json-smart-v2#78

It's probably worth trying one of the other mapping providers (JacksonMappingProvider, GsonMappingProvider, or JakartaJsonProvider) instead of the default JsonSmartMappingProvider.

@kallestenflo From the project description in the readme for json-smart, it seems like it isn't going to be actively developed. Perhaps it would be better if json path deprecates JsonSmartMappingProvider and instead defaults to one of the other ones. It also doesn't support JPMS.

@DevDengChao
Copy link

Perhaps it would be better if json path deprecates JsonSmartMappingProvider and instead defaults to one of the other ones.

Is there any plans to do that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants