Closed maximebochon closed 1 year ago
What exact error do you have?
The type of errors I get is like this:
Error: src/app/.../request-builder.ts:338:30 - error TS2569:
Type 'IterableIterator<QueryParameter>' is not an array type or a string type.
Use compiler option '--downlevelIteration' to allow iterating of iterators.
338 for (const queryParam of this._query.values()) {
About my previous comment, I now know that PhantomJS is deprecated and is not compatible with ES6.
If you edit the request-build.ts
file, and change that line to for (const queryParam of [...this._query.values()]) {
, does it work?
I get the same error with the proposed change. I think that the compatibility problem comes from the type returned by values()
which is IterableIterator
. I did not have time to figure out exactly what is not ES5 compatible.
By the way, the same problem exists for HeaderParameter
and PathParameter
.
Closing for lack of activity
I had to migrate an existing Angular project from Swagger 2 using
ng-swagger-gen
to OpenAPI 3 usingng-openapi-gen
.One of the issues I encountered was that the generated code seems not to be ES5 compliant. I had to change the
tsconfig
target fromes5
toes2015
to get rid of building problems.(As a consequence, I now can't run tests using Karma/PhantomJS and trying to use Babel as a workaround.)
ng-openapi-gen
produce ES5 compliant code only?Regards.