jsonschemafriend icon indicating copy to clipboard operation
jsonschemafriend copied to clipboard

net.jimblackler.usejson.SyntaxError: JSON5: invalid end of input at 1:1

Open tanmaymanolkar1 opened this issue 1 year ago • 15 comments

For the past 3 days we have been getting this error image

we are using sonGeneratorVersion = "0.4.3" jsonSchemaFriendVersion = "0.9.1"

Thanks for the help in advance!

tanmaymanolkar1 avatar Oct 05 '23 21:10 tanmaymanolkar1

Sorry about that it is fixed in the latest release but you do also need to locate and delete your schema cache.

Jim

On Thu, 5 Oct 2023, 22:48 tanmaymanolkar1, @.***> wrote:

For the past 3 days we have been getting this error [image: image] https://user-images.githubusercontent.com/65260743/273050464-fdec3924-dbc3-42f2-8ef3-851e26e695d7.png

we are using sonGeneratorVersion = "0.4.3" jsonSchemaFriendVersion = "0.9.1"

Thanks for the help in advance!

— Reply to this email directly, view it on GitHub https://github.com/jimblackler/jsonschemafriend/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFH6F252D5TOCNBSRUOOC3X54TLVAVCNFSM6AAAAAA5U5DDL2VHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZDSMJRGU2TENI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jimblackler avatar Oct 05 '23 21:10 jimblackler

is there any guidance I can follow to locate and delete the schema cache @jimblackler

tanmaymanolkar1 avatar Oct 05 '23 21:10 tanmaymanolkar1

The Usage link is not working, I was looking if any guidance was mentioned in the link. https://javadoc.jitpack.io/com/github/jimblackler/jsonschematypes/jsonschemafriend/0.12.0/javadoc/net/jimblackler/jsonschemafriend/package-summary.html

image

tanmaymanolkar1 avatar Oct 05 '23 22:10 tanmaymanolkar1

Regarding the broken link, it seems the docs aren't being published (it should be automatic). Sorry about that.

Regarding deleting the cache, I have a better solution which is that I've made a new release 0.12.1 of the library which renames the cache, which will force all clients to use a fresh cache. So try that.

I have also published a jsonschematypes (plugin) 0.9.2 which updates the dependency on the library.

On Thu, 5 Oct 2023 at 23:09, tanmaymanolkar1 @.***> wrote:

The Usage link is not working, I was looking if any guidance was mentioned in the link.

https://javadoc.jitpack.io/com/github/jimblackler/jsonschematypes/jsonschemafriend/0.12.0/javadoc/net/jimblackler/jsonschemafriend/package-summary.html

[image: image] https://user-images.githubusercontent.com/65260743/273056062-41e30968-2b3d-4efa-bb7b-14be0659a556.png

— Reply to this email directly, view it on GitHub https://github.com/jimblackler/jsonschemafriend/issues/31#issuecomment-1749722786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFH6F42G6WV75IMCIKN3CLX54VZDAVCNFSM6AAAAAA5U5DDL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZG4ZDENZYGY . You are receiving this because you were mentioned.Message ID: @.***>

jimblackler avatar Oct 05 '23 22:10 jimblackler

Thank you for the quick update. @jimblackler

I am seeing this error in the stack trace. I am using these versions testImplementation "net.jimblackler:jsongenerator:0.4.6" testImplementation "net.jimblackler:jsonschemafriend:0.12.1"

image

tanmaymanolkar1 avatar Oct 05 '23 22:10 tanmaymanolkar1

OK so it seems jsongenerator needed updating to use the new library and a fix for the way the cache works. I just published 0.4.7.

On Thu, 5 Oct 2023 at 23:30, tanmaymanolkar1 @.***> wrote:

Thank you for the quick update.

I am seeing this error in the stack trace [image: image] https://user-images.githubusercontent.com/65260743/273059419-30aa662f-a5dc-45b6-81e6-604beab33d3f.png

— Reply to this email directly, view it on GitHub https://github.com/jimblackler/jsonschemafriend/issues/31#issuecomment-1749743761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFH6F7JKMMK3X6E6YUH653X54YJBAVCNFSM6AAAAAA5U5DDL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZG42DGNZWGE . You are receiving this because you were mentioned.Message ID: @.***>

jimblackler avatar Oct 05 '23 22:10 jimblackler

great thanks, will let you know how it goes

tanmaymanolkar1 avatar Oct 05 '23 23:10 tanmaymanolkar1

Not able to find the package "net.jimblackler:jsongenerator:0.4.7" yet, I guess its taking time to get uploaded image

tanmaymanolkar1 avatar Oct 05 '23 23:10 tanmaymanolkar1

Try now.

On Fri, 6 Oct 2023, 00:48 tanmaymanolkar1, @.***> wrote:

Not able to find the package "net.jimblackler:jsongenerator:0.4.7" yet, I guess its taking time to get uploaded [image: image] https://user-images.githubusercontent.com/65260743/273069059-e7a95489-f0c5-4aa5-af0e-d25415661f42.png

— Reply to this email directly, view it on GitHub https://github.com/jimblackler/jsonschemafriend/issues/31#issuecomment-1749803148, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFH6F6KVZ322GPXJ6GKVXTX55BN7AVCNFSM6AAAAAA5U5DDL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZHAYDGMJUHA . You are receiving this because you were mentioned.Message ID: @.***>

jimblackler avatar Oct 05 '23 23:10 jimblackler

I am using this method generate() from net/jimblackler/jsongenerator/Generator.java image

And the object we are getting back is not of type JSONObject or JSONArray

image

and we end up with java.lang.IllegalArgumentException: object is not a JSON Object

I am using the following versions, we are not taking in the dependency on jsonschematypes library / image

Any idea what might have changed and how we can get past this issue

tanmaymanolkar1 avatar Oct 12 '23 23:10 tanmaymanolkar1

One main difference I see when this library worked Warning: Nashorn engine is planned to be removed from a future JDK release

to now when it is now working : I do not see the above warning

Is there any chance the Nashorn engine might be causing issues?

Also when in the JSON, I pass an object, it is not being parsed, that is no strings are being created for it from the generator, could you help me understand why is that? @jimblackler

tanmaymanolkar1 avatar Oct 13 '23 01:10 tanmaymanolkar1

a ping on the question above @jimblackler @jimblacklercorp

tanmaymanolkar1 avatar Oct 16 '23 21:10 tanmaymanolkar1

What is the type you are getting back?

jimblackler avatar Oct 17 '23 07:10 jimblackler

I am getting LinkedHashMap back @jimblackler, the issue I am seeing is that in nested json schema, where the parent JSON refers to child JSON objects, and the child JSON objects are not being tested, I get them as empty (unpopulated).

Do you reckon taking in the dependency on jsonschematypes library would help?

tanmaymanolkar1 avatar Oct 17 '23 16:10 tanmaymanolkar1

I'm not sure what's happened exactly in your case but I adapted the library a while back to use generic Java Maps, Lists and primitives vs. any particular Json wrapper library.

But you should easily be able to convert, e.g. (from memory) "new JsonObject(obj)"

On Tue, 17 Oct 2023 at 17:34, tanmaymanolkar1 @.***> wrote:

I am getting LinkedHashMap back @jimblackler https://github.com/jimblackler, the issue I am seeing is that in nested json schema, where the parent JSON refers to child JSON objects, and the child JSON objects are not being tested, I get them as empty (unpopulated).

Do you reckon taking in the dependency on jsonschematypes https://github.com/jimblackler/jsonschematypes/tree/master library would help?

— Reply to this email directly, view it on GitHub https://github.com/jimblackler/jsonschemafriend/issues/31#issuecomment-1766777142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFH6F5VU4I6XEAMHNQV7WTX72XRPAVCNFSM6AAAAAA5U5DDL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRWG43TOMJUGI . You are receiving this because you were mentioned.Message ID: @.***>

jimblackler avatar Oct 18 '23 18:10 jimblackler