-
Notifications
You must be signed in to change notification settings - Fork 63
Description
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.