-
Notifications
You must be signed in to change notification settings - Fork 762
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
Is there something missing in supporting OAS3 servers? #3143
Comments
Hi @fulviodenza, Good question. Investigating.... Maybe slightly related: #2967 |
We are already using the feature with no issues, opening a PR to remove the stale comment. |
@fulviodenza yes I can confirm as well. Probably the intention was to make server URLs absolute using the spec url when they are represented as relative URI Reference, but that is already handled in |
On the other hand, the following code is fully OpenAPI 2.0 specific: if (specUrl && specUrl.startsWith('http')) {
const parsed = new URL(specUrl);
if (!spec.host) {
spec.host = parsed.host;
}
if (!spec.schemes) {
spec.schemes = [parsed.protocol.replace(':', '')];
}
if (!spec.basePath) {
spec.basePath = '/';
}
} I think what the if (specUrl && specUrl.startsWith('http') && spec is OpenAPI 3.x.y) {
if (!spec.servers) {
spec.servers = [{ url: specUrl }];
}
} @fulviodenza what do you think? |
This change is specific to OpenAPI 3.x.y definitions. Refs #3143
I've issued #3219 to align the code with #3143 (comment) |
This change is specific to OpenAPI 3.x.y definitions. Refs #3143
Closed by #3219. @fulviodenza thanks for pointing this |
This change is specific to OpenAPI 3.x.y definitions. Refs #3143
Closed by #3220 which introduces spec compliant default for |
Sorry for not answering before didn't read, I'm happy this led to a fix! |
From this line we deduce that is still something missing in the OAS3 servers support:
swagger-js/src/index.js
Line 134 in 9463136
Although it looks it already has been added support to it:
https://github.com/swagger-api/swagger-js/tree/96d261987700297a472db5587c0a8c769095d73e/src/execute
I found it a bit confusing, is it to delete?
The text was updated successfully, but these errors were encountered: