openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] Option to add a default message for the validations

Open Deepu978 opened this issue 4 years ago • 2 comments

We are using open API to generate kotlin classes, i noticed there is no option to add validiation message in open api spec.

Example:

Here when the name fails the pattern or length validation i want to have an option to define custom message for each validation similar to what we have in javax validations to write a custom message for all validations

NewPet: type: object description: JSON defining a Pet object required: - name properties: name: type: string maxLength: 10 pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89AB][0-9a-f]{3}-[0-9a-f]{12}$

Deepu978 avatar Apr 21 '21 22:04 Deepu978

Any update on this

Deepu978 avatar May 10 '21 21:05 Deepu978

We are using open API to generate kotlin classes, i noticed there is no option to add validiation message in open api spec.

Example:

Here when the name fails the pattern or length validation i want to have an option to define custom message for each validation similar to what we have in javax validations to write a custom message for all validations

NewPet: type: object description: JSON defining a Pet object required: - name properties: name: type: string maxLength: 10 pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89AB][0-9a-f]{3}-[0-9a-f]{12}$

pattern validation have option to add validation message the others i think don't need....

rodrigoma3 avatar Jun 18 '24 05:06 rodrigoma3