Skip to content

[BUG] openapi-generator-maven-plugin native library with async does not generate fully httpcomponents.client5 code #22493

@mvhaasteren

Description

@mvhaasteren

To work with the native library and asyncNative=true I have to use the following dependencies:

  • org.apache.httpcomponents.client5:httpclient5:5.4.4
  • org.apache.httpcomponents:httpmime:4.5.14

Because generating an api class gets the imports of

  • import org.apache.http.HttpEntity
    Which comes from org.apache.httpcomponents:httpcore:4.4.16

But I expected it to come from org.apache.httpcomponents:httpcore5:5.3.4, which is part of the dependency list of the client5

The same counts for imports in the api for

import org.apache.http.NameValuePair;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;

full config in mvn project pom (the input-spec is en openapi 3.1.0 schema yaml):

            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>7.17.0</version>
                <executions>
                    <execution>
                        <id>dinq-client</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <globalProperties>
                                <skipFormModel>false</skipFormModel>
                            </globalProperties>
                            <inputSpec>${openapi-generator.input-spec}</inputSpec>
                            <generatorName>java</generatorName>
                            <configOptions>
                                <library>native</library>
                                <packageName>dinq-maven-plugin.client</packageName>
                                <generateApis>true</generateApis>
                                <generateApiDocumentation>false</generateApiDocumentation>
                                <apiPackage>${openapi-generator.base-package}.api</apiPackage>
                                <modelPackage>${openapi-generator.base-package}.model</modelPackage>
                                <generateSupportingFiles>true</generateSupportingFiles>
                                <configHelp>false</configHelp>
                                <generateSourceCodeOnly>true</generateSourceCodeOnly>
                                <disallowAdditionalPropertiesIfNotPresent>false
                                </disallowAdditionalPropertiesIfNotPresent>
                                <generateBuilders>true</generateBuilders>
                                <useJakartaEe>true</useJakartaEe>
                                <asyncNative>true</asyncNative>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions