Add support for templatedRef in Reference Object
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- À l'abandon
- Domaine
- api, backend-api-design
Piste de recherche
Commencez par examiner la définition de Reference Object, le matériel JSON Reference, RFC 6570 et la discussion liée sur les vocabulaires JSON Schema. Le travail est terminé lorsque la sémantique et la portée de $templatedRef sont convenues et spécifiées assez clairement pour prendre en charge les exemples de collection et de style.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Markdown
- Étoiles
- 31.2k
- Forks
- 9.2k
- Merge moyen
- 2 j 9 h
- PR mergées (30 j)
- 17
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de OAI/OpenAPI-Specification
-
Housekeeping
Difficulté 1/5 Moins d'une heure Accessibilité débutants 45/100
OAI/OpenAPI-Specification#5566 ·
Les mainteneurs répondent en général sous 1 jour
-
Housekeeping
Difficulté 1/5 Moins d'une heure Accessibilité débutants 35/100
OAI/OpenAPI-Specification#5562 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Housekeeping
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 10/100
OAI/OpenAPI-Specification#5556 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
v3.2.1 releasePeut-être à nouveau libre @lornajane l’a pris il y a 31 jours, et aucune pull request n’est ouverte. Ouverte
OAI/OpenAPI-Specification#5460 · 11 commentaires · 1 réaction · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
param serialization
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
OAI/OpenAPI-Specification#5366 · 12 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de OAI/OpenAPI-Specification
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
stripe/stripe-ruby#1994 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
KalicoCrew/kalico#1012 ·
Les mainteneurs répondent en général sous 1 jour
-
[Fehler]: /abdeckstift wirft 500 — part_type aus der Phonemreduction-Umbenennung nicht mitgezogenOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
wort-schule/wort.schule#787 ·
-
A numeric literal is parsed in the host's culture, so 1.5 is 15 in a made EXE on a comma-decimal OSOuvertebug interpreter silently-wrong small
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour