We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When you define a modelNamePrefix it also gets applied to the typeMappings target name. This causes that the importMappings not to match.
Example:
<modelNamePrefix>Abc</modelNamePrefix> <typeMappings>string+binary=Resource</typeMappings> <importMappings>Resource=org.springframework.core.io.Resource</importMappings>
generates an API class like:
import com.test.model.AbcResource; ... public Mono<AbcResource> getTransaction(String transactionId) { ...
but I would expect:
import org.springframework.core.io.Resource; ... public Mono<Resource> getTransaction(String transactionId) { ...
openapi-generator-maven-plugin 7.5.0
Maven plugin code
<plugin> <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <configuration> <generateModelDocumentation>false</generateModelDocumentation> <skipValidateSpec>false</skipValidateSpec> <strictSpec>true</strictSpec> <generateApiTests>false</generateApiTests> <generateModelDocumentation>false</generateModelDocumentation> <generateModelTests>false</generateModelTests> <modelNamePrefix>Abc</modelNamePrefix> <configOptions> <dateLibrary>java8</dateLibrary> <implicitHeaders>true</implicitHeaders> <java8>true</java8> <openApiNullable>false</openApiNullable> <swaggerAnnotations>false</swaggerAnnotations> <useSpringBoot3>true</useSpringBoot3> <useJakartaEe>true</useJakartaEe> <useTags>true</useTags> </configOptions> </configuration> <executions> <execution> <id>generate-transaction-api</id> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${project.basedir}/spec.yaml</inputSpec> <generatorName>java</generatorName> <library>webclient</library> <apiPackage>com.test.api</apiPackage> <modelPackage>com.test.model</modelPackage> <typeMappings>string+binary=Resource</typeMappings> <importMappings>Resource=org.springframework.core.io.Resource</importMappings> </configuration> </execution> </executions> </plugin>
spec.yaml:
openapi: 3.0.3 info: title: aaa version: 1.0.0 tags: - name: TransactionsV1 paths: /v1/transactions/{transactionId}: get: tags: - TransactionsV1 summary: abc operationId: getTransaction parameters: - name: transactionId in: path required: true description: The transaction id. schema: type: string responses: '200': description: abc content: application/pdf: schema: type: string format: binary
see above
Do not apply modelNamePrefix and modelNameSuffix to typeMappings target
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When you define a modelNamePrefix it also gets applied to the typeMappings target name. This causes that the importMappings not to match.
Example:
generates an API class like:
but I would expect:
openapi-generator version
openapi-generator-maven-plugin 7.5.0
OpenAPI declaration file content or url
Maven plugin code
spec.yaml:
Generation Details
see above
Steps to reproduce
see above
Suggest a fix
Do not apply modelNamePrefix and modelNameSuffix to typeMappings target
The text was updated successfully, but these errors were encountered: