OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
/* tslint:disable */
/* eslint-disable */
/**
* backend-sequelize
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
*/
export const AuthError = {
AuthTokenExpired: 'auth/token-expired',
} as const;
export type AuthError = (typeof AuthError)[keyof typeof AuthError];
export function instanceOfAuthError(value: any): boolean {
for (const key in AuthError) {
if (Object.prototype.hasOwnProperty.call(AuthError, key)) {
if (AuthError[key] === value) {
return true;
}
}
}
return false;
}
export function AuthErrorFromJSON(json: any): AuthError {
return AuthErrorFromJSONTyped(json, false);
}
export function AuthErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthError {
return json as AuthError;
}
export function AuthErrorToJSON(value?: AuthError | null): any {
return value as any;
}
It looks like the previous issue I had (https://github.com/OpenAPITools/openapi-generator/issues/18446) was resolved, but, unfortunately, I am still not able to upgrade.
My local setup give me the following type error:
The reason is that
key
is ont being cast to its correct type:an explicit cast would be necessary:
openapi.json
Generated model AuthError.ts (full)