swagger-api / swagger-editor

Swagger Editor
https://editor.swagger.io
Apache License 2.0
8.88k stars 2.24k forks source link

Can't Load Specs via URL? #4411

Open rockmasterflex69 opened 1 year ago

rockmasterflex69 commented 1 year ago

Q&A (please complete the following information)

Describe the bug you're encountering

Cannot load specs by URL

I can load external yaml specs through the Swagger Editor UI's load button, but NOT through navigation.

Worse: I cannot load yaml specs by URL that are hosted within the container, neither through the load button on the UI nor through the browser bar (eg http://localhost:8083/?url=http://localhost:8083/docs/my_spec.yaml) just opens pet store. These are valid specs and I can reach them directly within the container (as a file download) by going directly to their url like: http://localhost:8083/docs/my_spec.yaml

Actually ^ that was due to a cors issue. I am now using a custom container with cors more or less open wide and manual import of the localhost urls now works. Navigation with /?url still doesn't work though.

To reproduce...

Here is my docker compose: I am simply doing docker-compose-up and then using the UI @ http://localhost:8083/

version: '3'
services: 
  swagger-editor:
    image: swaggerapi/swagger-editor:v4.10.2
    ports:
      - 8083:8080
    volumes:
      - ./my_spec_files:/usr/share/nginx/html/docs

Expected behavior

I should be able to load whatever spec I define in the URL... not pet store!
My dockerized swagger editor should behave like the live one: https://editor.swagger.io/?url=https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/link-example.yaml

rockmasterflex69 commented 1 year ago

I'll also note: there are no browser error messages, nor container ones. It just simply loads pet shop... as if thats what I asked it to do

ukapavarapu commented 1 month ago

Any update on when this can be resolved