another random backend question :upside_down_face:...
# server
f
another random backend question 🙃 is there any way to make Dropwizard validation work nice with openapi generated objects? 🧵
my-service-api.yaml contains eg
Copy code
Address:
      type: object
      description: Represents the info related to a standardized address.
      required:
        - address1
        - city
        - state
        - zipCode
      properties:
        address1:
          type: string
          description: The first line of the street address.
          minLength: 1
          maxLength: 255
it generates an object like this
Copy code
data class Address (
    /* The first line of the street address. */
    @field:JsonProperty("address1")
    val address1: kotlin.String, // note, no validation annotations
we then use it like this
Copy code
@POST
    @Path("/calculate-taxes")
    @Consumes(MediaType.APPLICATION_JSON)
    @ServiceMachineAuthorization(
        scopes = ["orders-pricing.tax:calculate"],
        scopeCheckType = ScopeCheckType.ANY_OF
    )
    fun calculateTaxes(@NotNull @Valid taxableOrder: TaxableOrder): Response { //has address object in it
        ...
    }
but if I hit the endpoint with an address
Copy code
{
 address1: "string that is above 255 chars long"
}
DropWizard doesn't fail the request, it lets it through = is there any way to make DropWizard and openapi object generators work as far as validation goes?
k
is this issue due to kotlin?