Closed taavettik closed 1 year ago
Looks good 👍
On rest.ts we have:
if (config.COMMON_ENV !== 'prod') {
restMiddlewares.push(apiDocRouter.middleware());
}
And on graphql.ts we have:
introspection: ['local', 'dev', 'test'].includes(config.COMMON_ENV || ''),
playground: ['local', 'dev', 'test'].includes(config.COMMON_ENV || '')
We should unify these. [ 'local' ]
would be a safe default as this way you don't make docs/introspection and playground public by accident. You need to intentionally enable them for each environment instead. Maybe we should have environment variables API_DOCS_ENABLED: true
and API_PLAYGROUND_ENABLED: true
; enabled on docker-compose.yaml by default, and on helm-dev.yaml like this:
full-stack:
services:
server:
env:
# Enable if API docs and playground required on dev.
# API_DOCS_ENABLED: true
# API_PLAYGROUND_ENABLED: true
Maybe we should have environment variables
API_DOCS_ENABLED: true
andAPI_PLAYGROUND_ENABLED: true
; enabled on docker-compose.yaml by default, and on helm-dev.yaml like this:
I'd say that sounds wise. Will do
Replace the custom made api documentation generation method with OpenAPI-compatible schema generation from router JOI types