microsoft / microsoft/OpenAPI.NET.OData
Action and Operation do not expose $select and $expand over entity types
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 240
- Fork
- 70
- Merge medio
- 7h 59m
- PR unite (30g)
- 13
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con ComplexPropertyGetOperationHandler ed EdmOperationImportOperationHandler, quindi riproduci la funzione aggiuntiva registrata sull’entity set XFax. Confronta le operazioni generate per le funzioni che restituiscono entità con il comportamento previsto di $select e $expand. Il lavoro è completato quando il comportamento dell’handler è stato confermato e corretto, con una coverage per il caso segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- api, backend-api-design
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100