Json Parse Exception error #336

Closed
opened 2025-12-29 15:21:11 +01:00 by adam · 2 comments
Owner

Originally created by @ShaunJahn on GitHub (Feb 17, 2021).

On loading an OpenApiFile with WithMappingFromOpenApiFile im getting an exception:

Newtonsoft.Json.JsonReaderException: 'Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 1963.'

I think this might be due to MapOpenApiAnyToJToken using JObject.Parse instead of JToken.Parse

Could this be the case? Then open API document is valid and from swagger

Originally created by @ShaunJahn on GitHub (Feb 17, 2021). On loading an OpenApiFile with `WithMappingFromOpenApiFile` im getting an exception: `Newtonsoft.Json.JsonReaderException: 'Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 1963.'` I think this might be due to `MapOpenApiAnyToJToken` using `JObject.Parse` instead of `JToken.Parse` Could this be the case? Then open API document is valid and from swagger
adam added the question label 2025-12-29 15:21:11 +01:00
adam closed this issue 2025-12-29 15:21:11 +01:00
Author
Owner

@StefH commented on GitHub (Feb 17, 2021):

Can you please provide the document?

@StefH commented on GitHub (Feb 17, 2021): Can you please provide the document?
Author
Owner

@ShaunJahn commented on GitHub (Feb 17, 2021):

My apologies, my swagger document was not correct as it was bringing nulls where it needed strings.

@ShaunJahn commented on GitHub (Feb 17, 2021): My apologies, my swagger document was not correct as it was bringing nulls where it needed strings.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#336