Refactor the whole project
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 20/100
- Type d'issue
- Refactorisation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- csharp
- Domaine
- backend-api-design
Piste de recherche
Aucun fichier source ni test n’est indiqué. Commencez par retracer le flux de conversion OData-to-OpenAPI et examiner les IOpenApiODataConverter et IODataPathProvider proposés, les gestionnaires de path et operation, ainsi que l’exemple d’enregistrement de UseOpenApiOData. La tâche est considérée comme terminée lorsqu’une limite de service convenue et une conception de dependency injection prenant en charge une conversion personnalisée sont définies.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Short summary (3-5 sentences) describing the issue.
Recently, I got a lot of requirements, for example
- I don't want to expand on certain element
- I don't need this operation
- I need this ...
- etc..
Yes, we can meet all of these by modifying the codes, by adding settings, etc.
However, i'd think maybe it's time to refactor it in the next major release.
Design
I'd like to use the Dependency Injection to allow customer to customize the converting process.
We need figure out the working flow from OData to OpenAPI. The process steps are certain, at each step, we can create a service to work on it.
Services
We need figure out the services used during converting.
for example:
- we should have a OData path provider service
- we should have a OpenApi path generator service
- We should have a convert engine
Extension methods
I think we need
public static IServiceCollection UseOpenApiOData(IServiceCollection services)
{
services.AddSingleton<IOpenApiODataConverter>(); // converter or generator
services.AddSingleton<IODataPathProvider>();
services.AddSingleton<IODataOpenApiPathHandler>();
services.AddSingleton<IODataOpenApiOperationHandler>();
.....
service.AddSingleton<ODataOpenApiOptions>();
return services;
}
Usage
- you can create the OpenApiODataConverter instance (normal way)
- you can retrieve it from service provider.
IServiceCollection services= new ServiceCollection();
services.UserOpenApiOData();
IServiceProvider sp = services.CreateServiceProvider();
IOpenApiODataConverter converter = sp.GetService<IOpenApiODataConverter>();
...
Advantage
-
It can be used in the ASP.NET Core pipeline, for example we can create a middleware to generate the OpenAPI description for a OData service.
-
It can support to customize the converting. For example, we can replace a certain service using customized service.
- Langage dominant
- C#
- Étoiles
- 240
- Forks
- 70
- Merge moyen
- 7 h 59 min
- PR mergées (30 j)
- 13
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.OData
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
microsoft/OpenAPI.NET.OData#661 ·
-
Microsoft.OpenApi.OData.Reader.dll ships unversioned (0.0.0.0) since the 2026-01-16 releases Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
microsoft/OpenAPI.NET.OData#852 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
microsoft/OpenAPI.NET.OData#833 ·
-
status:needs-more-information
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
microsoft/OpenAPI.NET.OData#723 · 1 commentaire · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
microsoft/OpenAPI.NET.OData#720 ·
Toutes les issues de microsoft/OpenAPI.NET.OData
Issues similaires
-
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
-
t/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
ci-failure-cause test-failure
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
area:auth FE mvp P3
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
klasolsson81/jobbliggaren#1788 ·