You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AuthResponse & ErrorResponseObject are correctly created, but ErrorResponseObject is not used in case of 4XX or 5XX errors.
This is the generated file:
import*asruntimefrom'../runtime';importtype{Auth,AuthResponse,ErrorResponseObject,}from'../models';import{AuthFromJSON,AuthToJSON,AuthResponseFromJSON,AuthResponseToJSON,ErrorResponseObjectFromJSON,ErrorResponseObjectToJSON,}from'../models';exportinterfaceAuthenticateRequest{auth: Auth;}/** * */exportclassAuthenticateUserApiextendsruntime.BaseAPI{/** */asyncauthenticateRaw(requestParameters: AuthenticateRequest,initOverrides?: RequestInit|runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResponseErrorResponseObject>>{if(requestParameters.auth===null||requestParameters.auth===undefined){thrownewruntime.RequiredError('auth','Required parameter requestParameters.auth was null or undefined when calling authenticate.');}constqueryParameters: any={};constheaderParameters: runtime.HTTPHeaders={};headerParameters['Content-Type']='application/json';constresponse=awaitthis.request({path: `/authentication`,method: 'POST',headers: headerParameters,query: queryParameters,body: AuthToJSON(requestParameters.auth),},initOverrides);returnnewruntime.JSONApiResponse(response,(jsonValue)=>AuthResponseFromJSON(jsonValue));}/** */asyncauthenticate(requestParameters: AuthenticateRequest,initOverrides?: RequestInit|runtime.InitOverrideFunction): Promise<AuthResponse>{constresponse=awaitthis.authenticateRaw(requestParameters,initOverrides);returnawaitresponse.value();}}
As you can see ErrorResponseObject is imported but never used.
This creates multiple issues down the line. The main one is that I cannot use the ErrorResponseObject attributes to let the user know what the error actually is.
The text was updated successfully, but these errors were encountered:
I have an openapi spec for authentification with few responses types:
The AuthResponse & ErrorResponseObject are correctly created, but ErrorResponseObject is not used in case of 4XX or 5XX errors.
This is the generated file:
As you can see
ErrorResponseObject
is imported but never used.This creates multiple issues down the line. The main one is that I cannot use the
ErrorResponseObject
attributes to let the user know what the error actually is.The text was updated successfully, but these errors were encountered: