Add support for templatedRef in Reference Object
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Área
- api, backend-api-design
Línea de trabajo
Comienza revisando la definición de Reference Object, el material de JSON Reference, RFC 6570 y la discusión enlazada sobre los vocabularios de JSON Schema. El trabajo estará terminado cuando la semántica y el alcance de $templatedRef estén acordados y especificados con suficiente claridad para admitir los ejemplos de collection y style.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Proposing to add support for "$templatedRef" to Reference Objects supporting templated references, allowing referencing dynamic schemas that could be retrieved by substituting the template variables by the selected value for earlier path parameters
so that later path parameters can be defined differently based on earlier path parameters.
Example:
"parameters" :
{
"collection-styleId" :
{
"name" : "styleId",
"schema" :
{
"$templatedRef" : "./api/collections-styles/{collectionId}"`
}
}
}
As it was initially suggested that this would require to first extend JSON schema, an initial discussion took place in https://github.com/json-schema-org/json-schema-vocabularies/issues/36 . However reading on https://swagger.io/specification/ that the Reference Object is defined by the JSON Reference, rather than by JSON Schema, it seems that this could rather simply be extended with$templatedRef, following https://tools.ietf.org/html/rfc6570 (or a simpler subset of it).
The {collectionId} template would be replaced by a selected value like collection1.
(e.g. in this example, this "$templatedRef" is used to define the valid values for {styleId} in a path /collections/{collectionId}/styles/{styleId}).
The {collectionId} would have previously been validated against another potentially dynamic list like "$ref" : "./api/collections".
./api/collections would return something like:
{
"type" : "string",
"enum" : [
"collection1",
"collection2",
"collection3"
]
}
and ./api/collection-styles/collection1 would return something like
{
"type" : "string",
"enum" : [
"style234",
"style235",
"style236"
]
}
while ./api/collection-styles/collection2 would return something like
{
"type" : "string",
"enum" : [
"style454",
"style455",
"style456"
]
}
The context being that available/compatibles styles depend on the selected collection.
Such a capability would allow to define much more interoperable APIs, where the specifics of a particular instance / deployment would be left to the templated references. In turn this would allow to automatically generate clients from an API definition that will work with multiple instances of the same templatable API, therefore extending the usability of clients automatically generated from OpenAPI definitions beyond on-the-fly client generation, more suitable for compiled programming languages.
- Lenguaje dominante
- Markdown
- Estrellas
- 31.2k
- Forks
- 9.2k
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 17
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OAI/OpenAPI-Specification
-
Housekeeping
Dificultad 1/5 Menos de una hora Aptitud para principiantes 45/100
OAI/OpenAPI-Specification#5566 ·
Los mantenedores suelen responder en 1 día
-
Housekeeping
Dificultad 1/5 Menos de una hora Aptitud para principiantes 35/100
OAI/OpenAPI-Specification#5562 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Housekeeping
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
OAI/OpenAPI-Specification#5556 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
v3.2.1 releaseQuizá libre de nuevo @lornajane la tomó hace 31 días y no hay ningún pull request abierto. Abierto
OAI/OpenAPI-Specification#5460 · 11 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
param serialization
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
OAI/OpenAPI-Specification#5366 · 12 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de OAI/OpenAPI-Specification
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Yeachan-Heo/gajae-code#6611 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
llm translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
area: storage maintenance priority: low status: accepted
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
amatya-aditya/obsidian-rss-dashboard#1019 ·
Los mantenedores suelen responder en 1 día