EndpointFilterFactoryContext supplies endpoint-definition details while the application is being built. A filter factory uses it to inspect the handler and decide whether to create a filter for that endpoint. section 5.4.3
The context provides information that ordinary filter invocation context does not:
- MethodInfo exposes the endpoint handler’s method signature, including its parameters. section 5.4.3
- EndpointMetadata supplies additional endpoint details for factory decisions. section 5.4.3
- A factory can inspect parameters such as a string id, return the next delegate when no match exists, and create a tailored filter when it does. section 5.4.3
One factory for different handlers
A validation factory can attach to both GET /fruit/{id} with parameters (string id) and POST /fruit/{id} with parameters (Fruit fruit, string id). It examines each handler through EndpointFilterFactoryContext and creates a filter that locates the id argument regardless of its position.
