-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Introduce [ApiController] #6821
Conversation
|
||
using Microsoft.AspNetCore.Mvc.Filters; | ||
|
||
namespace Microsoft.AspNetCore.Mvc.Internal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really the right place for this interface, but we don't have another good existing one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is this interface? I read the doc comment but it isn't clear to me why it's needed. What else would implement it? Or is it to avoid coupling to the ApiControllerAttribute
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. The last one.
For instance this attribute is only supported on classes, because that's how we image you'll want to use it. But there's nothing wrong with you implementing your own marker.
It short, there's value in separating policy from specification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, makes sense.
This puts a de-facto metadata approach in the box to declare unambiguously 'Hey, I am an API!'. I think this is worth us doing at this point because I haven't really seen anyone in the community running with targeting conventions at equivalence classes of controllers. Now that we're putting API-specific, opinionated behaviors in the box, we need to away to make it opt-in and declarative.
8485ed4
to
e114911
Compare
namespace Microsoft.AspNetCore.Mvc | ||
{ | ||
/// <summary> | ||
/// Indicates that a type and all derived types are used to serve HTTP API responses. The presense of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, it looks like you are posting on a closed issue/PR/commit!
We're very likely to lose track of your bug/feedback/question unless you:
- Open a new issue
- Explain very clearly what you need help with
- If you think you have found a bug, include detailed repro steps so that we can investigate the problem
Thanks!
This puts a de-facto metadata approach in the box to declare
unambiguously 'Hey, I am an API!'.
I think this is worth us doing at this point because I haven't really
seen anyone in the community running with targeting conventions at
equivalence classes of controllers.
Now that we're putting API-specific, opinionated behaviors in the box,
we need to away to make it opt-in and declarative.