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
When using an OpenAPI spec that describes the shape of the error response for a 400 bad request, I am unable to use that as the type to get completions and make the TS compiler happy when trying to use the properties from that error response model from my API.
Hopefully I have left enough info below to help diagnose or reproduce the issue.
Cheers,
Warren 😄
Reproducible example or configuration
My usage with unable to get error back as a nice type
// TODO: error will come back as this shape of JSON/*{ "type": "Error", "title": "Unauthorized", "status": 400, "detail": "Only the original user who locked this content can unlock it or a super user with the unlocking permission"}*/const{ data, error }=awaitContentLockService.lockOverview()as{data: LockOverviewResponse,error: LockOverviewError};;if(error){this._notificationCtx?.peek('danger',{data: {headline: error.title,// error still seems to be `unknown`message: error.detail}})...}
Heyo @warrenbuckley, nice to see you again! I'll get back to this package hopefully next week once the platform is live as I see a lot of issues piling up 😔
Heya 👋
OK I will keep an eye on this issue for updates. Not sure if my C# code that outputs the OpenAPI Schema is generated correctly or if its something with Hey-API.
Description
When using an OpenAPI spec that describes the shape of the error response for a 400 bad request, I am unable to use that as the type to get completions and make the TS compiler happy when trying to use the properties from that error response model from my API.
Hopefully I have left enough info below to help diagnose or reproduce the issue.
Cheers,
Warren 😄
Reproducible example or configuration
My usage with unable to get error back as a nice type
Generated Client Files from Schema
schemas.gen.ts
services.gen.ts
types.gen.ts
OpenAPI specification (optional)
System information (optional)
General
package.json Versions
The text was updated successfully, but these errors were encountered: