UUID Validation Errors

12 views
Skip to first unread message

Ammar Khan

unread,
Dec 17, 2019, 11:45:39 PM12/17/19
to jackson-user
I am using Atlassian's swagger-request-validator-restassured library that pulls in Jackson core, databind, datafromat-yaml and datatype-jdk versions 2.9 and dataformat-cbor version 2.6.7. The library is essentially validate a given REST request against an OpenApi/Swagger schema (yaml). A part of that is validating the path parameters in the request url. To do this, the request validator's SchemaValidator class is invoked which in turn invokes the Json.mapper().readTree(value) method from the com.fasterxml.jackson.databind package. In my case, my value is the UUID 4aea209d-9055-45f0-90f6-081fa7348943. I expected the readTree() method to be handle this just but instead I end up with the following error.... 

error1.PNG



I debugged and followed the error through to line 4030 of the _readTreeAndCLose(JsonParser p0) but I am not sure why this is happening. I have verified that the UUID I have is a valid UUID and I do not seem to get the error with other UUIDs such 00000000-0000-0000-000000000000. Any insights into whether this a valid error or whether it is a defect would be appreciated. 




Ammar Khan

unread,
Dec 17, 2019, 11:45:39 PM12/17/19
to jackson-user
So I am using the swagger-request-validator-restassured library which internally makes use of jackson core and databind verisons 2.9.5. I am running into some UUID validation errors when the library attempts to validate the path parameters in my REST request url. The particular UUID that is causing me problems is actually 4aea209d-9055-45f0-90f6-081fa7348943. When the request validator method begins to validate the path parameters, it makes a series of internal method calls until its readContent method in its SchemaValidator class gets invoked. This class than calls Json.mapper().readTree(value) from the com.fasterxml.jackson.databind package. The value in this scenario is just the UUID 4aea209d-9055-45f0-90f6-081fa7348943. The readTree method than calls the _readTreeAndClose(JsonParaser p0) method which is where I get the following error.... 

error1.PNG


I have verified that the UUID in question is a valid UUID and I have run tests with other UUIDs such 00000000-0000-0000-000000000000 that do not experience the same issue. I am not entirely sure whether this a defect with the Jackson library or whether this is a valid failure so any insight would be appreciated. 


Tatu Saloranta

unread,
Dec 17, 2019, 11:48:12 PM12/17/19
to jackson-user
You would need to contact author of that library first, or, provide a test case that only uses Jackson.
In latter case we might be able to help.

Exception message itself suggests invalid JSON, and not validation issue.

-+ Tatu +-

 
Reply all
Reply to author
Forward
0 new messages