Add support for $schema and jsonSchemaDialect
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- csharp, openapi
- Domaine
- api, backend-api-design
Piste de recherche
Commencez par suivre les désérialiseurs et sérialiseurs de OpenAPISchema et identifier où l’hypothèse 2020-12 est appliquée. Définissez le service JSON Schema autour de l’enregistrement des dialectes, de la résolution du fallback, de la gestion récursive des schémas inconnus et des contraintes de sécurité ; le travail est terminé lorsque $schema et jsonSchemaDialect sélectionnent le dialecte connu ou chargé correct sans modifier le comportement existant.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
In today's implementation (2.11.0, 3.9.0), the deserialization and serialization of JSON Schemas is effectively hard-coded to 2020-12.
However, starting with OpenAPI 3.1, people can set the $schema property of any given schema to a different dialect (default being documented here.
This entails a couple of things:
- parsing that keyword first if it exists, or falling back on the document dialect property, or falling back to the default value for the OpenAPI version.
- if that value is known (like
https://spec.openapis.org/oas/3.1/dialect/baseusing the parsing logic associated with that entry - if that value is unknown, we need to load the corresponding schema, and read its schema (recursively) until we find a known value. (note be careful of the security considerations here)
Note: ideally we'd make the OpenAPISchema type generic and allow the caller to provide new registrations of schemas uris with the corresponding parsing logic and data type, but that'd introduce major breaking changes, making the cost prohibitive.
That update will most likely require introducing a JSON Schema service of some kind in charge of mapping the known schemas with their deserialization logic, and having the OpenAPISchema deserializers call into that service.
- Langage dominant
- C#
- Étoiles
- 1.6k
- Forks
- 286
- Merge moyen
- 6 h 38 min
- PR mergées (30 j)
- 35
Guide de contribution
Ouvrir 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 microsoft/OpenAPI.NET
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
microsoft/OpenAPI.NET#2798 ·
-
microsoft/OpenAPI.NET#3056 · 1 commentaire · 1 réaction · 2 personnes assignées ·
-
type:breaking-change
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
microsoft/OpenAPI.NET#3014 · 2 commentaires ·
-
Implement equality (`IEquatable<T>` and override object.Equals/GetHashCode) for object models Ouvertehelp wanted
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
microsoft/OpenAPI.NET#2989 · 3 commentaires ·
-
help wanted type:feature
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
microsoft/OpenAPI.NET#2967 · 18 commentaires · 1 réaction ·
Toutes les issues de microsoft/OpenAPI.NET
Issues similaires
-
release-notes in .NET 11 RC2 Ouvertepriority-0
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
StackExchange/StackExchange.Redis#3249 ·
-
[Feat] 조합 영역 구분선 개선 Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
type/automation type/tech-debt
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100