I want to review the error response types specifications and improve the type-safe, OpenAPI-first design.
The current implementation required the use of IResult i.e. the "loose" type to return a custom error. However, this requires manual annotation to the Configure() method, which is different from the desired result that the type is safe and the OpenAPI schema is automatically derived by default.
Therefore, I will improve the IEndpoint interface so that the OpenAPI schema is automatically derived by explicitly specifying the type even if I return a custom error in my plan.
I want to review the error response types specifications and improve the type-safe, OpenAPI-first design.
The current implementation required the use of
IResulti.e. the "loose" type to return a custom error. However, this requires manual annotation to theConfigure()method, which is different from the desired result that the type is safe and the OpenAPI schema is automatically derived by default.Therefore, I will improve the
IEndpointinterface so that the OpenAPI schema is automatically derived by explicitly specifying the type even if I return a custom error in my plan.