Skip to content

Conversation

stevendarby
Copy link

Omit key services with derived attribute from OpenAPI definitions

Instead of checking the attribute type is exactly FromKeyedServicesAttribute, it now checks if it's assignable to it, so that it also covers derived attributes.

Note, I find the relatively newer IsAssignableTo easier to follow than IsAssignableFrom so opted for that, and in a slightly opinionated way I changed the existing code on that line to use that too, for some local consistency. I hope that's ok.

Fixes #58739

@stevendarby stevendarby requested review from a team, captainsafia and halter73 as code owners July 26, 2025 21:03
@github-actions github-actions bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Jul 26, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 26, 2025
@stevendarby
Copy link
Author

Oops, I was slow off the mark and only just realised @martincostello already raised a PR for this. There are some more improvements to the tests than in my PR, so I'll close this.

@captainsafia
Copy link
Member

@stevendarby Thanks nonetheless for being willing to open a PR! 😄

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

Labels

area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates community-contribution Indicates that the PR has been added by a community member

2 participants