xerions / phoenix_swagger

Swagger integration to Phoenix framework
Mozilla Public License 2.0
687 stars 180 forks source link

Default PetStore Sample #292

Open StephSanchez opened 2 months ago

StephSanchez commented 2 months ago

Hi,

In my project, I attempted to directly include the master branch as a dependency using {:phoenix_swagger, git: "https://github.com/xerions/phoenix_swagger.git"} to benefit from the latest updates to Swagger UI 5.2. However, when I request the display of my Swagger UI, I am instead directed to the default 'PetStore' example.

I believe this issue stems from the 'priv/static/swagger-initializer.js' file, which utilizes the 'url' parameter set to 'https://petstore.swagger.io/v2/swagger.json'. This parameter is likely directing the Swagger UI to display the default PetStore example instead of my custom project's Swagger documentation.

Could you please advise me on how to update the code to resolve this issue? I would greatly appreciate your assistance.

Thank you in advance for your time and consideration.

Sincerely,

fastjames commented 1 month ago

I encountered the same problem, and I was able to work around it by modifying that url to point to swagger.json (commit https://github.com/xerions/phoenix_swagger/commit/db7461d2f5089d9852feb57cf8ee3342cf412f0d). Credit to @nikola-frame who showed me the way in https://github.com/mainframe2/phoenix_swagger/commit/1f84113f049205f7ada0c6aeacb5a245c8f65811 .