[BUG][typescript-angular] The ApiInterface import statement for the Configuration doesn't take use the configurationPrefix option
Created by: Thessi
Description
This issue occurs when both the configurationPrefix
and the withInterfaces
options are used.
While the Configuration field in the interface correctly uses the configurationPrefix, the import for the Configuration tries to import Configuration
, which leads to an error.
...
import { Configuration } from '../configuration';
...
configuration: {{configurationClassName}};
...
In https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache , the import is already correct, so the used class name and the import name match up. This should also be done in the apiInterface
openapi-generator version
5.0.0
Generation Details
minimal maven configuration:
<configuration>
...
<generatorName>typescript-angular</generatorName>
<configOptions>
<withInterfaces>true</withInterfaces>
<configurationPrefix>Api</configurationPrefix>
</configOptions>
</configuration>
Suggest a fix
Adjust the import statement here: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache#L11
The correct import statement would be:
import { {{configurationClassName}} } from '../configuration';