Skip to content

Commit

Permalink
skip empty arguments and throws
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 3, 2024
1 parent 8d10e3d commit aa2453a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/typeschema-angular-editor/src/lib/export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ExportService {
args['payload'] = payload;
}

if (this.isset(operation.arguments) && Array.isArray(operation.arguments)) {
if (this.isset(operation.arguments) && Array.isArray(operation.arguments) && operation.arguments.length > 0) {
operation.arguments.forEach((argument) => {
if (argument.in === 'query' || argument.in === 'header') {
const schema = this.resolveType(argument.type);
Expand All @@ -133,7 +133,7 @@ export class ExportService {
result.arguments = args;
}

if (this.isset(operation.throws) && Array.isArray(operation.throws)) {
if (this.isset(operation.throws) && Array.isArray(operation.throws) && operation.throws.length > 0) {
const throws: Array<any> = [];
operation.throws.forEach((throw_) => {
const ret: any = {
Expand Down

0 comments on commit aa2453a

Please sign in to comment.