swagger-definition.js 576 B

12345678910111213141516171819202122232425262728293031
  1. const pkg = require('../package.json');
  2. const apiVersion = process.env.API_VERSION || '3';
  3. const basePath = (apiVersion === '1' ? '/_api' : `/_api/v${apiVersion}`);
  4. module.exports = {
  5. openapi: '3.0.1',
  6. info: {
  7. title: `GROWI REST API v${apiVersion}`,
  8. version: pkg.version,
  9. },
  10. servers: [
  11. {
  12. url: `https://demo.growi.org${basePath}`,
  13. },
  14. ],
  15. security: [
  16. {
  17. api_key: [],
  18. },
  19. ],
  20. components: {
  21. securitySchemes: {
  22. api_key: {
  23. type: 'apiKey',
  24. name: 'access_token',
  25. in: 'query',
  26. },
  27. },
  28. },
  29. };