OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
22.01k stars 6.6k forks source link

[BUG][typescript-axios] Broken client #9036

Open vmstarchenko opened 3 years ago

vmstarchenko commented 3 years ago

Bug Report Checklist

Description

openapi-generator create broken client for attached schema. Errors:

openapi-generator version

5.0.1 latest dev version

OpenAPI declaration schema

https://gist.github.com/vmstarchenko/9671d45499a66d73b6746e69168c6cc5

Generation Details
java -jar ./openapi-generator-5.0.1/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ./api-spec.yaml -g typescript-axios --additional-properties=useSingleRequestParameter=true -o ./client/typescript-axios

Generated client: https://gist.github.com/vmstarchenko/5128a715559fcb065649b37b316f3be9

Steps to reproduce

Generate typescript-axios client with useSingleRequestParameter additional property and attached schema

Related issues/PRs
Suggest a fix
vmstarchenko commented 3 years ago

Please, reopen this issue. Only second problem (with DataForm usage error) has been solved. There are still two other problems:

lumoe commented 3 years ago

I can confirm this error behavior, tested it with latest version 5.1.1 with the same error message Property 'join' does not exist on type 'Set'.

Sadly I won't be able to track this issue down within the openapi-generator source code.

For anyone experiencing this issue, my workaround is to cast the affected variable to any. assignedUsers.join(COLLECTION_FORMATS['csv']) to (assignedUsers as any).join(COLLECTION_FORMATS['csv'])