Api End point is exposed even if PropertyValue bool = false of Navigational property
@xuzhg is already working on this.
Since Aug 31, 2021.
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
Short summary (3-5 sentences) describing the issue.
Swagger displays API on the UI even if PropertyValue bool = false
OData validation rules do not currently check if annotations containing properties of navigation or property paths are valid or reachable
Assemblies affected
Which assemblies and versions are known to be affected e.g. OData .Net lib 7.x
Reproduce steps


We see that even though property value bool = false, we still see the API end points exposed on the swagger UI
The above IEdmModel is parsed and converted to OpenApiDocument and later which is displayed in swagger


The End points Put, Post and Delete should not be displayed as it is not reachable. This may be because of the property value attribute bool = false.
This causes an issue when trying to invoke these api’s
For Example If I try to post


As we can see the endpoint does not exists and there by we get 405 exception. Is the exception occurring due to property value attribute bool = false? And the swagger displaying the endpoint. What should be done to hide such API's
Expected result
All the API End points which are not reachable should not be displayed on swagger.
Actual result
The API End points which are not reachable are displayed on swagger.
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.