Bug Report Checklist
Description
At least for the Spring Boot code generator:
Validation constraints like minLength, maxLength, pattern defined for parameters within request bodies of
application/x-www-form-urlencoded content are not generated in the API interfaces.
The formParams.mustache is missing the beanValidationBodyParams template call (as opposed for example to the regular bodyParams.mustache).
I have provided a PR that fixes this problem for the Spring Boot generator -> #21749
Please let me know if there is anything more I can / have to do to get this fix included in the next release ;-)
openapi-generator version
7.14.0
OpenAPI declaration file content or url
openapi: 3.0.1
info:
title: Test form
version: 1.0.0
servers:
- url: https://where.am.i
paths:
/add:
post:
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- id
- quantity
properties:
name:
type: string
pattern: '^[[:print:]]+$'
quantity:
type: integer
minimum: 1
responses:
'200':
description: OK
content:
application/json:
schema:
type: boolean
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
I fixed this in #21749
Bug Report Checklist
Description
At least for the Spring Boot code generator:
Validation constraints like minLength, maxLength, pattern defined for parameters within request bodies of
application/x-www-form-urlencoded content are not generated in the API interfaces.
The formParams.mustache is missing the beanValidationBodyParams template call (as opposed for example to the regular bodyParams.mustache).
I have provided a PR that fixes this problem for the Spring Boot generator -> #21749
Please let me know if there is anything more I can / have to do to get this fix included in the next release ;-)
openapi-generator version
7.14.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
I fixed this in #21749