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

drf-spectacular is fetching JS from CDN #454

Closed
pombredanne opened this issue May 18, 2021 · 2 comments · Fixed by #542
Closed

drf-spectacular is fetching JS from CDN #454

pombredanne opened this issue May 18, 2021 · 2 comments · Fixed by #542

Comments

@pombredanne
Copy link
Member

See tfranzel/drf-spectacular#389
It would be better if not

@pombredanne
Copy link
Member Author

Reopening for review after this message from @tfranzel #542 (comment)

Hi,
I watched this a bit from the sidelines and I have to admit I'm a bit puzzled. Maybe I have been too imprecise in my statements.

nobody is forcing you to use the CDN. if you are so inclined, you are free to change those settings and host your swagger-ui build yourself. that is exactly the reason why the setting is there.

You then partially did what I recommended; ingesting the distribution builds into your static folder. So far so good. However, instead of simply setting 'REDOC_DIST': '//cdn.jsdelivr.net/npm/redoc@next' to 'REDOC_DIST': 'YOUR_STATIC_ROOT/api_doc', you went ahead removed spectacular altogether and hard-coded the schema. You could call that throwing out the baby with the bath water.

The whole point of spectacular is not having stale, outdated hard-coded API specifications. This kind of defeats the purpose of the whole thing but I digress. But on a lighter note, we just added your request: https://github.com/tfranzel/drf-spectacular#self-contained-ui-installation

This installs https://github.com/tfranzel/drf-spectacular-sidecar, which is an optional package containing all those assets. The package sources from jsdelivr and releases a PyPi package containing those static files. Basically what you did in this PR. Just some food for thought. Have a good day!

@pombredanne
Copy link
Member Author

This is now closed with tfranzel/drf-spectacular#389

pombredanne added a commit that referenced this issue Oct 28, 2022
This will help generate an Open API documentation now that we do not
have CDN issues anymore with:
tfranzel/drf-spectacular#389

Referenced-by: #454
Thanks-you-to: T. Franzel @tfranzel
Signed-off-by: Philippe Ombredanne <[email protected]>
TG1999 pushed a commit that referenced this issue Nov 1, 2022
This will help generate an Open API documentation now that we do not
have CDN issues anymore with:
tfranzel/drf-spectacular#389

Referenced-by: #454
Thanks-you-to: T. Franzel @tfranzel
Signed-off-by: Philippe Ombredanne <[email protected]>
TG1999 pushed a commit to TG1999/vulnerablecode that referenced this issue Nov 4, 2022
This will help generate an Open API documentation now that we do not
have CDN issues anymore with:
tfranzel/drf-spectacular#389

Referenced-by: aboutcode-org#454
Thanks-you-to: T. Franzel @tfranzel
Signed-off-by: Philippe Ombredanne <[email protected]>
pombredanne added a commit that referenced this issue Nov 8, 2022
This will help generate an Open API documentation now that we do not
have CDN issues anymore with:
tfranzel/drf-spectacular#389

Referenced-by: #454
Thanks-you-to: T. Franzel @tfranzel
Signed-off-by: Philippe Ombredanne <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant