Skip to content
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

Can't Load Specs via URL? #4411

Open
rockmasterflex69 opened this issue Sep 1, 2023 · 1 comment
Open

Can't Load Specs via URL? #4411

rockmasterflex69 opened this issue Sep 1, 2023 · 1 comment

Comments

@rockmasterflex69
Copy link

rockmasterflex69 commented Sep 1, 2023

Q&A (please complete the following information)

  • OS: Windows
  • Browser: chrome
  • Version: Version 116.0.5845.111 (Official Build) (64-bit)
  • Method of installation: official docker container
  • Swagger-Editor version: swaggerapi/swagger-editor:v4.10.2
  • Swagger/OpenAPI version: OpenAPI 3.0

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
Copy link
Author

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

jenkin added a commit to sparkfabrik/nominatim-openapi that referenced this issue Oct 3, 2023
Swagger UI now loads the minified OpenAPI spec.

Swagger Editor (latest version) doesn't support custom spec passed with envars or url parameters (see [swagger-editor/issues/4411](swagger-api/swagger-editor#4411)).

Refs: #2
jenkin added a commit to sparkfabrik/nominatim-openapi that referenced this issue Nov 6, 2023
Swagger UI now loads the minified OpenAPI spec.

Swagger Editor (latest version) doesn't support custom spec passed with envars or url parameters (see [swagger-editor/issues/4411](swagger-api/swagger-editor#4411)).

Refs: #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant