typescriptopenapi-generatoropenapi-generator-cli

Why is the interface generated with such 'quotes' in openapitools/openapi-generator-cli? typescript


my result

I use https://github.com/OpenAPITools/openapi-generator-cli Why is the interface generated with such 'quotes' in openapitools/openapi-generator-cli?

My command

openapi-generator-cli generate -g typescript-axios -i  http://127.0.0.1:8000/api/swagger/?format=openapi -o node_modules/@api-client --additional-properties=npmName=@api-client --additional-properties=snapshot=false --additional-properties=withSeparateModelsAndApi=true --additional-properties=modelPackage=models --additional-properties=apiPackage=apis --additional-properties=supportsES6=true

Here is the desired result


Solution

  • I found a solution. It was necessary to add the 'queryParamObjectFormat' parameter with the value 'key'

    Final command is

    openapi-generator-cli generate -g typescript-angular -i  http://127.0.0.1:8000/api/swagger/?format=openapi -o node_modules/@api-client --additional-properties=npmName=@api-client --additional-properties=snapshot=false --additional-properties=withSeparateModelsAndApi=true --additional-properties=modelPackage=models --additional-properties=apiPackage=apis --additional-properties=supportsES6=true --additional-properties=queryParamObjectFormat=key