The flask-apispec package we use to convert marshmallow schema to swagger documentation is using a fixed old swagger version, also it had a fixed path for the static files. So in order to override the static files path, we override some of the methods of the package. This happens in webapp/api_spec.py. And we copy-pasted the static files form the package in the root folder. For now, we will use the remote scripts of the swagger-ui, so the static files are no longer needed. So I deleted them.
Ideally we would have the swagger-ui as a dependency in package.json. Copy the necessary .js files form node_modules in a static folder then update package.json and Dockerfile to do this for us on deploy. But considering this is the only front-end dependency we have for the API, I thought it's not worth it.
Done
Update documentation version.
The
flask-apispec
package we use to convert marshmallow schema to swagger documentation is using a fixed old swagger version, also it had a fixed path for thestatic
files. So in order to override thestatic
files path, we override some of the methods of the package. This happens inwebapp/api_spec.py
. And we copy-pasted thestatic
files form the package in the root folder. For now, we will use the remote scripts of theswagger-ui
, so the static files are no longer needed. So I deleted them.Ideally we would have the
swagger-ui
as a dependency in package.json. Copy the necessary.js
files formnode_modules
in astatic
folder then updatepackage.json
andDockerfile
to do this for us on deploy. But considering this is the only front-end dependency we have for the API, I thought it's not worth it.Issue / Card
Fixes #https://github.com/canonical-web-and-design/ubuntu-com-security-api/issues/57