Skip to content

Commit c176bdc

Browse files
authored
[rust][reqwest] fix broken export (#6586)
* fix broken export * add tests
1 parent 2c37217 commit c176bdc

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

bin/rust-petstore-reqwest-async.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@"
30-
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 $@"
30+
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 $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

modules/openapi-generator/src/main/resources/rust/reqwest/api_mod.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub use self::{{{classFilename}}}::{ {{{operationId}}} };
4646
{{#vendorExtensions.x-group-parameters}}
4747
{{#allParams}}
4848
{{#-first}}
49-
pub use self::{{{classFilename}}}::{{{operationIdCamelCase}}} as {{{classname}}}{{{operationIdCamelCase}}};
49+
pub use self::{{{classFilename}}}::{{{operationIdCamelCase}}}Params as {{{classname}}}{{{operationIdCamelCase}}}Params;
5050
{{/-first}}
5151
{{/allParams}}
5252
{{/vendorExtensions.x-group-parameters}}

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,7 @@
11681168
<module>samples/client/petstore/cpp-qt5</module>
11691169
<module>samples/client/petstore/rust</module>
11701170
<module>samples/client/petstore/rust/reqwest/petstore</module>
1171+
<module>samples/client/petstore/rust/reqwest/petstore-async</module>
11711172
<module>samples/client/petstore/php/OpenAPIClient-php</module>
11721173
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
11731174
<!--<module>samples/client/petstore/javascript-apollo</module>-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<project>
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.openapitools</groupId>
4+
<artifactId>RustReqwestAsyncClientTests</artifactId>
5+
<packaging>pom</packaging>
6+
<version>1.0-SNAPSHOT</version>
7+
<name>Rust Reqwest Async Petstore Client</name>
8+
<build>
9+
<plugins>
10+
<plugin>
11+
<artifactId>maven-dependency-plugin</artifactId>
12+
<executions>
13+
<execution>
14+
<phase>package</phase>
15+
<goals>
16+
<goal>copy-dependencies</goal>
17+
</goals>
18+
<configuration>
19+
<outputDirectory>${project.build.directory}</outputDirectory>
20+
</configuration>
21+
</execution>
22+
</executions>
23+
</plugin>
24+
<plugin>
25+
<groupId>org.codehaus.mojo</groupId>
26+
<artifactId>exec-maven-plugin</artifactId>
27+
<version>1.2.1</version>
28+
<executions>
29+
<execution>
30+
<id>bundle-test</id>
31+
<phase>integration-test</phase>
32+
<goals>
33+
<goal>exec</goal>
34+
</goals>
35+
<configuration>
36+
<executable>cargo</executable>
37+
<arguments>
38+
<argument>build</argument>
39+
</arguments>
40+
</configuration>
41+
</execution>
42+
</executions>
43+
</plugin>
44+
</plugins>
45+
</build>
46+
</project>

0 commit comments

Comments
 (0)