-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
$refs failed to resolve with such error: "Could not resolve reference: Failed to execute 'delete' on 'Headers': Headers are immutable" #8532
Comments
The issue is in again in swagger-client on this line. |
Headers are immutable and thus we cannot remove headers from it. This works in To fix this, we have to clone the response in order to mutate it. More info in https://developer.mozilla.org/en-US/docs/Web/API/Headers |
Further context: we're removing |
Fetch API doesn't allow to mutate Response or any associated objects like Headers. Removing the Content-Type header allows us to skip the JSON/YAML serialization. To skip the serialization we have clone the Response and Headers objects and remove the Content-Type header in clones. This doesn't apply to node-fetch@2 which API allows to mutate Response and all associated objects. Refs swagger-api/swagger-ui#8532
Addressed in upstream: swagger-api/swagger-js@1df6b38 |
@char0n Wow, I am impressed, blazingly fast debug & fix, thank you! I am going to check whether it fixes this issue (I am prettty sure it should). |
This bug fix comes via swagger-client@3.19.5. Refs #8532
Addressed for swagger-ui@5 in #8536 |
Release will be comming in an half an hour. Please keep the issues related to OpenAPI 3.1.0 comming. OpenAPI 3.1.0 support in swagger-ui@5 is current priority and I appreciate any early feedback that you provide. |
This bug fix comes via swagger-client@3.19.5. Refs #8532
OS: Ubuntu 22.04.1
Browser: Chromium-based
Version 108.0.0.0
Method of installation: via docker image swaggerapi/swagger-ui
Swagger-UI version: v5.0.0-alpha.4
Swagger/OpenAPI version: 3.1.0
The installation is the same as in #8525 (comment).
After I successfully applied the workaround about absolute paths for
$ref
, I see in the browser console that requests for schemas began to go to the correct host - and even return with a 200 response.But I found another problem:
$ref
inside uploaded documents refuse to load, I see a lot of red error messages with the following text:I see nor errors in the browser console neither non-ok requests in its Network tab.
In addition, when I click on the dropdown arrow next to each operation, the operation dropdown does not drop out - just the dropdown arrow changes to "open" and that's it. I believe this is related: apparently due to the fact that
$ref
has not loaded, there is nothing to show in the operation dropdown.Perhaps the reason for this is the same as in the previous issue: incorrect resolution of relative paths. I hope that after fixing that problem, this problem will also go away. But perhaps this is not related, I do not have enough SwaggerUI context to judge with complete confidence - therefore, I am creating this issue in order to inform the development team about the difficulties that arise.
The text was updated successfully, but these errors were encountered: