Skip to content

OData API Explorer Produces Incorrect URLs By Convention #226

Closed
@commonsensesoftware

Description

@commonsensesoftware

Symptoms

When the ODataApiExplorer is used with ODataControllers that route by the standard OData conventions, the API descriptor URL is not correctly generated.

Triage

The EDM model keys and action descriptor parameter names are matched to build the URL paths. When the OData conventions are used, the parameter name must be key. The name key may not be the name of the key member in the EDM model. This results in the entity key segment being generated incorrectly or not at all.

Proposed Solution

The default conventions only allow for a single named key. Multi-key entities must use attribute routing. To maintain parity with the routing rules, the API explorer will match a convention-based key using the following:

  • The action description has a parameter with the name key
  • The entity in the EDM model has exactly one key
    • The entity key does not have to have the name key

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions