Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Environment Variables in definition

Abierto
#33 15 comentarios 13 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #238 de @baywet — cerrado sin fusionar

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
openapi
Área
api

Línea de trabajo

No se nombran archivos de implementación ni pruebas. Empieza por leer la discusión, los issues vinculados de OpenAPI y el pull request de Swagger UI para entender el alcance previsto. Para darlo por terminado, se requiere acordar un modelo implementable de variables de entorno para las definiciones, incluido cómo se declaran y referencian los valores.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Sorry if this came up before, I searched but could not find anything.

Environment variables have become something of the de facto mechanism to set server-specific values, then access them from software. The hosting providers I have worked with (AWS, Heroku, OpenShift) all offer features to easily set/import/export them and most software I've seen meant to run on these systems uses it for things like environment specific URLs, secrets etc.

But afaik there is no way to reference environment variables in an OpenAPI definition.

Would this be a feature to support? I imagine the definition having a section (probably at the top level) that specified a set of environment variables expected to be set, and possibly the default values to use when they are not set. Those variables could then be used in other parts of the definition.

My practical use cases comes from needing to set different authorization urls for different environments. Currently I am rendering swagger.json from JSP to implement this myself, but it seems to me this is a very generic use case that many people will face.

See also e.g.
https://github.com/OAI/OpenAPI-Specification/issues/169
https://github.com/OAI/OpenAPI-Specification/issues/779
https://github.com/swagger-api/swagger-ui/pull/3410

Lenguaje dominante
JavaScript
Estrellas
122
Forks
38
Merge medio
1 d 17 h
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OAI/Overlay-Specification

Todos los issues de OAI/Overlay-Specification

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.