diff --git a/tck/src/main/java/org/eclipse/microprofile/openapi/apps/beanvalidation/BeanValidationResource.java b/tck/src/main/java/org/eclipse/microprofile/openapi/apps/beanvalidation/BeanValidationResource.java index 8d6a5b8d..7d60e4ad 100644 --- a/tck/src/main/java/org/eclipse/microprofile/openapi/apps/beanvalidation/BeanValidationResource.java +++ b/tck/src/main/java/org/eclipse/microprofile/openapi/apps/beanvalidation/BeanValidationResource.java @@ -16,9 +16,11 @@ package org.eclipse.microprofile.openapi.apps.beanvalidation; import jakarta.validation.Valid; +import jakarta.validation.constraints.Size; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; import jakarta.ws.rs.core.MediaType; @Path("/") @@ -28,4 +30,9 @@ public class BeanValidationResource { @Consumes(MediaType.APPLICATION_JSON) public void test(@Valid BeanValidationData data) { } + + @POST + @Path("parameter/{test}") + public void test(@PathParam("test") @Size(max = 6) String size) { + } } diff --git a/tck/src/main/java/org/eclipse/microprofile/openapi/tck/beanvalidation/BeanValidationTest.java b/tck/src/main/java/org/eclipse/microprofile/openapi/tck/beanvalidation/BeanValidationTest.java index b051f850..0b231efa 100644 --- a/tck/src/main/java/org/eclipse/microprofile/openapi/tck/beanvalidation/BeanValidationTest.java +++ b/tck/src/main/java/org/eclipse/microprofile/openapi/tck/beanvalidation/BeanValidationTest.java @@ -195,6 +195,15 @@ public void defaultAndOtherGroupsTest(String format) { assertProperty(vr, "defaultAndOtherGroups", hasEntry("minLength", 1)); } + @Test(dataProvider = "formatProvider") + @RunAsClient + public void parameterTest(String format) { + ValidatableResponse vr = callEndpoint(format); + String schemaPath = dereference(vr, "paths.'/parameter/{test}'.post.parameters[0]", "schema"); + vr.body(schemaPath, hasEntry("maxLength", 6)); + vr.body(schemaPath, hasEntry("type", "string")); + } + /** * Asserts that a property from the test schema matches the given matcher *