microsoft / microsoft/OpenAPI.NET.OData
Provide a way to not generate navigation paths with key
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 240
- Fork
- 70
- Merge medio
- 7h 59m
- PR unite (30g)
- 13
Descrizione
I am new to implementing my first OData service. I am using OData for .NET 8+ with the ODataConventionModelBuilder to generate my model.
When a navigation property references an entity that is indexable, a path is generated of the form
Entity({ID})/NavEntity({ID1}) or Entity/{ID}/NavEntity/{ID1}.
The routing conventions don't include this path. They only support navigation to the NavEntity level. It would be helpful if there were a way to configure the conversion not to generate navigation paths with the key, even though the entity has one. As a practical matter, I'm not sure when I would need to query the navigation property by key, especially if the navigation property is available as a root entity.
As a workaround, I have added code to remove the unsupported paths from the OpenApiDocument before serializing it. As the OData service evolves, this code has to also evolve. If the conversion didn't generate the path with multiple keys, this workaround code would be unnecessary.
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
Traccia la conversione di ODataConventionModelBuilder attraverso la generazione di OpenApiDocument e le convenzioni di routing. Individua dove vengono aggiunti i percorsi di navigazione con chiave, quindi determina come la configurazione potrebbe sopprimerli e verifica che i documenti generati omettano tali percorsi non supportati senza rimuovere le route di navigazione valide.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- api, backend-api-design
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100