Skip to content

Commit

Permalink
fix(typescript): error property of error responses is always any (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaSch0212 authored Dec 20, 2024
1 parent b3bd784 commit 10fd597
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
...Object.entries(statusCodes).map(([key, value]) => {
const isSuccess = key.startsWith('2');
return ts.intersectionType<Builder>([
isSuccess ? ts.refs.angular.httpResponse([value.type]) : ts.refs.angular.httpErrorResponse(),
isSuccess
? ts.refs.angular.httpResponse([value.type])
: ts.refs.omit([ts.refs.angular.httpErrorResponse(), ts.string('error')]),
ts.objectType({
members: [
isSuccess ? null : ts.property('error', { type: ts.unionType([value.type, ts.refs.null_()]) }),
Expand Down

0 comments on commit 10fd597

Please sign in to comment.