swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

SwaggerEditor@next(legacy): add env support to Dockerfile

Open tim-lai opened this issue 3 years ago • 0 comments

Feature parity with legacy SwaggerEditor@4:

  • [ ] accept url
  • [ ] accept local file

Out of scope, but consistency with SwaggerUI:

  • [ ] generic list of args to pass as props

Additional context:

  • CRA requires static files to be located in the public/static directory.
  • CRA accepts env flags, but these env flags are set at build time and non-mutable afterwards.
  • Will likely to need to add code checks for supported env variables.

Notes:

  • legacy swagger-editor only contains SWAGGER_FILE AND URL env variables, with no other consideration of swagger-ui.
  • legacy swagger-editor implementation does not appear to be directly portable.

From readme in this PR, which enables the basic environment variable, https://github.com/swagger-api/swagger-editor/pull/3200:

Building a Docker container with custom environment variables is not currently supported by SwaggerEditor. This is due to the inability of npm to handle scoped packages that are outside of the public npm registry. In the case of SwaggerEditor, @swagger-api/apidom-ls is a dependency currently only residing in Github packages. It is in the roadmap to make @swagger-api/apidom-ls, as well as this version of SwaggerEditor, available in the public npm registry.

tim-lai avatar Jul 15 '22 17:07 tim-lai