[rust][reqwest] fix broken export (#6586)

* fix broken export

* add tests
This commit is contained in:
William Cheng 2020-06-09 15:56:56 +08:00 committed by GitHub
parent 2c3721720e
commit c176bdcb3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 2 deletions

View File

@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@"
ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust --library reqwest -o samples/client/petstore/rust/reqwest/petstore-async --additional-properties supportAsync=true,packageName=petstore-reqwest-async $@"
ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust --library reqwest -o samples/client/petstore/rust/reqwest/petstore-async --additional-properties supportAsync=true,useSingleRequestParameter=true,packageName=petstore-reqwest-async $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -46,7 +46,7 @@ pub use self::{{{classFilename}}}::{ {{{operationId}}} };
{{#vendorExtensions.x-group-parameters}}
{{#allParams}}
{{#-first}}
pub use self::{{{classFilename}}}::{{{operationIdCamelCase}}} as {{{classname}}}{{{operationIdCamelCase}}};
pub use self::{{{classFilename}}}::{{{operationIdCamelCase}}}Params as {{{classname}}}{{{operationIdCamelCase}}}Params;
{{/-first}}
{{/allParams}}
{{/vendorExtensions.x-group-parameters}}

View File

@ -1168,6 +1168,7 @@
<module>samples/client/petstore/cpp-qt5</module>
<module>samples/client/petstore/rust</module>
<module>samples/client/petstore/rust/reqwest/petstore</module>
<module>samples/client/petstore/rust/reqwest/petstore-async</module>
<module>samples/client/petstore/php/OpenAPIClient-php</module>
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
<!--<module>samples/client/petstore/javascript-apollo</module>-->

View File

@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>RustReqwestAsyncClientTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Rust Reqwest Async Petstore Client</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>bundle-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cargo</executable>
<arguments>
<argument>build</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>