eclipse-vertx / vertx-openapi

OpenAPI repository
Other
10 stars 7 forks source link

Path parameter format uuid fails #84

Open re-thc opened 3 weeks ago

re-thc commented 3 weeks ago

Version

4.5.10

Context

Setting a path parameter of type: string and format: uuid never works. Removing the format works.

The message always returns: The value of path parameter id is invalid. Reason: String does not match format \"uuid\"

io.vertx.openapi.validation.SchemaValidationException: The value of path parameter id is invalid. Reason: String does not match format "uuid" at io.vertx.openapi.validation.SchemaValidationException.createInvalidValueParameter(SchemaValidationException.java:39) at io.vertx.openapi.validation.impl.RequestValidatorImpl.validateParameter(RequestValidatorImpl.java:132) at io.vertx.openapi.validation.impl.RequestValidatorImpl.lambda$null$2(RequestValidatorImpl.java:99) at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:191) at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:270) at io.vertx.core.impl.ContextImpl.lambda$internalExecuteBlocking$2(ContextImpl.java:210) at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

Do you have a reproducer?

CheesyBoy123 commented 2 weeks ago

Hey @re-thc thanks for the report. Can you pass a sample UUID that is failing? They should all be checked against this regex https://github.com/eclipse-vertx/vertx-json-schema/blob/4.x/src/main/java/io/vertx/json/schema/impl/Format.java#L85. Im wondering if the regex is potentially wrong here. Also, if this is something you are willing to dog into I can help point you in the right direction 🙂

Thanks!