-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Make example string conform to regex #7829
Make example string conform to regex #7829
Conversation
b6ec23a
to
8288247
Compare
I have cleaned up the code |
8288247
to
d9759cf
Compare
Rebased |
Any particular reason why this isn't being merged in? Am I missing something? |
@dewijones92 Thanks for the PR, it functionally works for me. However, can you update so that it passes the
|
150102e
to
6392726
Compare
@tim-lai I have amended |
6392726
to
b4633a4
Compare
b4633a4
to
dcdaa4b
Compare
rebased |
@dewijones92 PR merged! Thanks for the contribution! |
Hi there, I just opened an issue relative to this feature.., it's look like Swagger-ui now expects a @Schema Example attribute to be always specified, cause if you define a @pattern on your field but you dont specify an @Schema(example="") value something go wrong and try it out section is so verbose by 'error': You can check the issue here: #8003 And the repo with a easily reproducible demo here: https://github.com/GandalfTheBlack16/demo-swagger Thanks so much! |
@tim-lai @dewijones92 |
If your app is Java application and using this internally I have had luck adding this annotation from io.swagger.v3.oas.annotations.media.Schema to override pattern value in UI. |
Description
Make the example string conform to the regex pattern
Motivation and Context
Otherwise the request body is invalid
How Has This Been Tested?
Created unit test for it
Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests