C#C
C#11mo ago
Tiger

nswag (OpenApi) typescript get error type

Hey, I'm generating an api client using nswag, here is an example route:

[HttpPost("BeginLogin")]
    [ProducesResponseType(typeof(AppError), 400)]
    [ProducesResponseType(typeof(BeginLoginResponse), 200)]
    public async Task<ActionResult> BeginLogin([FromBody] BeginLoginRequest request)


However, in the client itself the response is not a union type, but simply the 200 default type... How am I supposed to get the error in the frontend (typescript)?

beginLogin(authorization: any | undefined, request: BeginLoginRequest): Promise<BeginLoginResponse>{}
Was this page helpful?