Skip to content

OData API Explorer Produces Incorrect URLs By Convention #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
commonsensesoftware opened this issue Dec 27, 2017 · 0 comments
Closed
Assignees

Comments

@commonsensesoftware
Copy link
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant