-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JAVA] Missing @Pattern in generated code #7980
Comments
I have the same issues, can someone help out please? |
Hi @Michus001, have you figured out how to generate pattern when using $ref with a simple String? |
@FatCash Unfortunatelly, no progress. I moved validations to my internal model and I don't rely on Swagger validations anymore. |
Thats too bad. I guess I will have to do the same since I cannot edit the API from the vendor :( |
… confirm that issue #7980 is solved with these changes.
hey @Michus001 @FatCash sorry for delay, i was waiting for swagger core and parser releases in order to proceed to fix this issue. Anyway, this was fixed with PR #8277 , can you please verify it when you have a chance? |
* master: Update README.md fixed NPE on `getHasQueryParams` method. Fix getHasQueryParams to take authMethods into account added null check. added pattern, mixLength, maxLength from "non object" model to a codegen property. updated dependencies versions on CI pom files. bump to released versions Fix getter methods for Java model with additionalProperties set required on response property when schema is not null. updated swagger core and swagger parser versions, also added tests to confirm that issue swagger-api#7980 is solved with these changes. fixed index out of bound exception for inline empty example field. Fix for uncompilable java client if no model definitions i specified (swagger-api#7836) Add option modelPropertyNaming to javascript generator Update PetStore sample Configuration option to disable HTML escaping when using Gson
@HugoMario Have this issue been fixed in 3.0.0 rc1? I have the same issue using the latest snapshot of rc1. Thanks. |
Hi @lubinson, can you please try with https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.0 ? |
@HugoMario I have dowloaded the latest swagger code generator(3.0.0), but facing the same issue. The pattern is completely missing from the generated code. |
Same. |
Unable to generate the annotation for pattern |
Yeah same here. I have in my components/schema in the .yml a schema like this. I am using openapi: 3.0.0
The annotation for the regex is missing in the generated code |
Hi , has this issue been resolved as i am currently using openapi generator 6 and still unable to generate the regex patterns for the fields in the contract that have patterns. are there any workarounds or is there a particular version that would allow the models to generate with the required regex patterns |
Description
I wanted to reuse some string fileds with regexp pattern (in the example below, it is currency field). I move them to definitions and tried to generate server. Unfortunatelly, there isn't any Pattern annotation in generated java code. If I move Currency directly to Amount, Pattern annotation is correctly generated.
Swagger-codegen version
swagger-codegen-maven-plugin 2.3.1
swagger: 2.0
Swagger declaration file content or url
If you post the code inline, please wrap it with
Generated Java code:
Command line used for generation
Steps to reproduce
Config options:
Related issues/PRs
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: