Improve 3.1+ schema `$id` UX
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é
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- json
- Domaine
- api
Piste de recherche
Commencez par comparer les définitions existantes schema et schema-base d’OAS 3.1, notamment la manière dont dialect/base et meta/base sont référencés. Le travail est terminé lorsqu’un schéma au nom intuitif fournit la validation par défaut du Schema Object tout en permettant aux ressources intégrées de changer de métaschéma, et que le comportement incomplet de schema est rendu plus évident.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Currently, we have the following schema document $ids for OAS 3.1 (shown relative to a base URI of https://https://spec.openapis.org/oas/3.1/, and without the trailing date segment that all schemas need to support updates:
schema# Validates everything except the Schema Object, which is only validated againsttype: [boolean, object]schema-base# Extendsschemato validate Schema Objects againstdialect/baseand require both$schemaandjsonSchemaDialectto be set toschema's$idif they are presentdialect/base# A dialect equivalent to the default 2020-12 dialect plus the OAS extensionsmeta/base# The vocabulary metaschema for the OAS extensions
schema-base was named to indicate that it incorporates dialect/base. No one is certain why the dialect and vocabulary are referred to as "base", but they are called that in the OAS text as well. I vaguely recall discussing the dialect as a base for further OAS-relevant extensions? Perhaps that is what the intent was.
AFAICT, the advantage of schema is that it's self-contained. But giving it that name means that it is the schema that most people assume is what they want, yet it really does not produce the behavior they'd expect.
schema-base is closer to what people would expect, but is (in my view) overly restrictive in locking $schema to dialect/base, as it is valid to switch metaschemas if $schema appears alongside $id, and conforming JSON Schema implementations know to treat $id-containing subschemas as embedded resources and check for a changed metaschema. However, this does not make schema-base wrong: Users might indeed want to enforce using only dialect/base, and this is the correct way to do that.
On the other hand (and contrary to some of my comments earlier on Slack), schema-base locking jsonSchemaDialect to dialect/base is probably correct. If you want to set jsonSchemaDialect to something else, you would want a schema that validates Scheam Objects accordingly by default.
We probably shouldn't change how schema behaves, but we should make it more obvious that it is incomplete. We should also come up with some sort of intuitive name for a schema that is like schema-base but does not restrict $schema. This name needs to convey that most users will want this new schema, and not the plain schema.
Ideally, I'd prefer to make copies of the vocabulary and dialect and give them the URIs dialect/oas and meta/oas (3.1 is already present earlier in the URI), but that is probably more trouble than it is worth given that I imagine very few people pay attention to those other than to just load them correctly when using schema-base.
The important thing is to have an intuitively-named schema that performs the default accepted Schema Object validation but still allows switching metaschemas on embedded resources. That is the default behavior of the OAS, and it's not currently provided.
- Langage dominant
- Markdown
- Étoiles
- 31.3k
- Forks
- 9.2k
- Merge moyen
- 2 j 3 h
- PR mergées (30 j)
- 8
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 8/100
OAI/OpenAPI-Specification#5571 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
OAI/OpenAPI-Specification#5570 ·
Les mainteneurs répondent en général sous 1 jour
-
Housekeeping
Difficulté 1/5 Moins d'une heure Accessibilité débutants 45/100
OAI/OpenAPI-Specification#5566 · 5 commentaires ·
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
-
v3.2.1 releasePeut-être à nouveau libre @lornajane l’a pris il y a 36 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
Toutes les issues de OAI/OpenAPI-Specification
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
debpalash/VoiceStudio#2936 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
melgarafael/DeskcommCRM#3000 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
components-web-app/docs#243 ·
-
OFN writer emits `DocIRI` as a bare IRI, which becomes a version IRI or a parse error on re-readOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
phillord/horned-owl#338 ·
Les mainteneurs répondent en général sous 1 jour