microsoft / microsoft/OpenAPI.NET.OData
Action and Operation do not expose $select and $expand over entity types
Personne n'a encore pris cette issue.
- Langage dominant
- C#
- Étoiles
- 240
- Forks
- 70
- Merge moyen
- 7 h 59 min
- PR mergées (30 j)
- 13
Description
Action and Operation do not expose $select and $expand over entity types while this is possible for /entity/propertyOfComplexType
Assemblies affected
Microsoft.OpenApi.OData 1.7.5
Steps to reproduce
Register additional function for entity set:
var fax = builder.EntityType<XFax>();
fax.Collection.Function(nameof("GetByNumber"))
.ReturnsFromEntitySet<XFax>("Fax")
.NonNullable()
.Parameter<string>("number").NonNullable();
Expected result
GetByNumber should have both $select and $expand operations because XFax is Entity type
Actual result
No operations available
Additional detail
I see that ComplexPropertyGetOperationHandler has the following logic:
- Expose $top, $skip, $search, $filter $count for a collection
- Try to expose $select and $expand
On the contrary EdmOperationImportOperationHandler has the following logic:
- Expose $top, $skip, $search, $filter $count for a collection
- Expose $select and $expand if 1. is true
Therefore I can't get $select and $expand for Function or Operation. Is it something explicitly prohibited by OData?
How can I do this in a different way?
P.S. I think as a workaround I can make alternate key. But I don't see any examples for OData 8
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.
Piste de recherche
Commencez par ComplexPropertyGetOperationHandler et EdmOperationImportOperationHandler, puis reproduisez la fonction supplémentaire enregistrée sur l’ensemble d’entités XFax. Comparez les opérations générées pour les fonctions qui renvoient des entités avec le comportement attendu de $select et $expand. Le travail est terminé lorsque le comportement du handler est confirmé et corrigé, avec une couverture du cas signalé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp
- Domaine
- api, backend-api-design
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100