Skip to content

Conversation

Gilbert32
Copy link

@Gilbert32 Gilbert32 commented Sep 22, 2025

When Minimal Apis are not used, and controllers are, ODataQueryOptions<TEntity> always calls PopulateMetadata(), which will always add metadata of type ODataMiniMetadata to the endpoint.

Currently, when httpContext.IsMinimalEndpoint() is called, it checks whether ODataMiniMetadata exists which is always the case.

This commits makes it additionally check for an HttpMethodAttribute in the endpoint metadata.

Additionally, when PopulateMetadata() was called, the endpointBuilder.Metadata list was empty, so it was not possible to check for other attributes.

…false positives

When Minimal Apis are not used, and controllers are, ODataQueryOptions<TEntity> always calls PopulateMetadata, which will always add metadata of type ODataMiniMetadata to the endpoint.
Currently, when IsMinimalEndpoint is called, it checks whether ODataMiniMetadata exists which is always the case.
This commits makes it additionally check for an HttpMethodAttribute in the endpoint metadata.
@Gilbert32
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant