flowup / api-client-generator

Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
MIT License
115 stars 21 forks source link

noany() function problem #98

Closed Mark12870 closed 3 years ago

Mark12870 commented 3 years ago

While the property doesn't have type. Swagger example:

Model:
    type: object
    properties:
      metadata: {}

(According to https://editor.swagger.io/ it is valid syntax.)

The generator will generate in guards/index.ts this line of code:

    // metadata?: any
    ( typeof arg.metadata === 'undefined' || isany(arg.metadata) ) &&

But the function isany() doesn't exists.

vmasek commented 3 years ago

@Mark12870 I apologise for the delay in addressing this, there will be a version with a refactored parser for types and guards released soon.

As of right now, you can rewrite the line to ( typeof arg.metadata === 'undefined' || typeof arg.metadata === 'object' ) &&