Back to overview
Maintenance

Hosting Swagger Docs

Jan 23 at 12:30pm AEDT  –  Jan 23 at 04:30pm AEDT
Affected services
api.dev.co-pr.com

Resolved
Jan 23 at 12:30pm AEDT

Pull Request: NGINX Configuration Update for Swagger Docs
Overview
This pull request updates the NGINX configuration to properly serve Swagger documentation for the API. The changes ensure that the /swagger/ route is correctly mapped and serves the Swagger UI files, as well as the YAML API specification for iOS and Android.

Changes Made
Updated NGINX configuration:

Added a location block for serving Swagger UI HTML files under /swagger/.
Configured the Swagger API YAML files (iosApi.yaml and androidApi.yaml) to be served under /ios and /android.
Applied aliasing for Swagger UI assets to ensure they are correctly served from /usr/share/nginx/html/swagger-ui/.
Set the correct MIME type for YAML files to application/yaml.
NGINX Error Logging:

Added error logging configuration with debug level to help with troubleshooting.
Testing
Swagger UI Access:

Tested accessing https://api.dev.co-pr.com/swagger/ to verify that Swagger UI loads correctly.
Ensured that the /swagger/index.html loads and displays the API documentation.
YAML File Access:

Accessed /swagger/ios and /swagger/android to confirm that the correct YAML files (iosApi.yaml and androidApi.yaml) are being served and the content is valid.
HTTP to HTTPS Redirection:

Ensured that HTTP traffic is properly redirected to HTTPS.
Related Issues
None
Checklist
Updated NGINX configuration to serve Swagger documentation
Tested Swagger UI and YAML file access
Enabled error logging for debugging
Verified HTTP to HTTPS redirection is functional
Additional Information
The configuration is now set up to serve Swagger UI from /swagger/ and YAML files from /ios and /android.
Ensure that the file paths for the YAML files are correct and they are accessible within the NGINX container.