Open AndreKoepke opened 4 years ago
I found out that a validation is already in open-api-spec.
Here is nice article how to use them: https://www.baeldung.com/spring-rest-openapi-documentation#beanvalidation
The spring
-generator using this validation-informations already and makes great code.
But the typescript-angular
-generator cannot do validations.
So the new subject of this issue is: Change the generator to add validation-annotations in typescript.
I want to use this npm-package for annotations (aka decorators): https://github.com/typestack/class-validator
If there are other opinions, then let me know.
This ticket is reference to keep my work tracked
Is your feature request related to a problem? Please describe.
Nope.
Subject changed
New description
typescript-angular
can generate code with decorators for validation.Old description
I would like to have a Code-Generator for validation-checks. I know that's not part of the OpenAPI spec yet. For my bachelor thesis I will try to implement that. See my fork for updates: https://github.com/AndreKoepke/openapi-generator
I will focus on java and typescript generators.
As example (from swagger pet-store example). For this spec:
I want to have a java-class like this
Or typescript class like this