-
Notifications
You must be signed in to change notification settings - Fork 533
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
2.0.18 regression wrong error message when validating the server url #1329
Comments
@jimschubert did some analysis in OpenAPITools/openapi-generator#5413 (comment) The issue is triggered by this line: Lines 410 to 418 in ee9d1a6
The validate method: Lines 458 to 466 in ee9d1a6
Is not considering that the server can contains server-variables. So adding a warning in the else case as introduced by PR #1301 is not a good idea. If you would like to validate the server URL properly, you need to resolve the server-variables first. |
I would suggest to revert this change as of now. I will raise a new PR for the original issue 1236 |
Hi, I'm going to review why has this regression happend and work a fix, if indeed we need to reverse we will. Thanks! 👍 |
This appears to happen with relative URLs, too. For example: {
"openapi": "3.0.2",
"servers": [
{
"url": "/api/v1"
}
]
[snip]
} generates: |
Hi thanks, for spotting this I have reverted the changes and added a test to prevent this from happening again. @r-sreesaran about the issue #1236 is it still happening? |
@gracekarina i've spotted a similar issue on the openapi generator, not sure if it's related: OpenAPITools/openapi-generator#8033 |
This example spec:
With version
2.0.18
this is now reporting errors:With
2.0.17
this was not the case.This can also be reproduced with the example provided in the official spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#server-object-example
The text was updated successfully, but these errors were encountered: