Skip to content
New issue

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

[Rust] set supportAsync to true as the default #6480

Merged
merged 2 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
set supportAsync to true
  • Loading branch information
wing328 committed May 29, 2020
commit 8236f86498b14c056a7646f76311ad65e291aac0
2 changes: 1 addition & 1 deletion bin/rust-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ for spec_path in \
--input-spec $spec_path
--generator-name rust
--output samples/client/petstore/rust/$library/$spec
--additional-properties packageName=${spec}-${library}
--additional-properties packageName=${spec}-${library},supportAsync=false
--library=$library $@"
java ${JAVA_OPTS} -jar ${executable} ${args} || exit 1
done
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_label: rust
|library|library template (sub-template) to use.|<dl><dt>**hyper**</dt><dd>HTTP client: Hyper.</dd><dt>**reqwest**</dt><dd>HTTP client: Reqwest.</dd></dl>|hyper|
|packageName|Rust package name (convention: lowercase).| |openapi|
|packageVersion|Rust package version.| |1.0.0|
|supportAsync|If set, generate async function call instead| |false|
|supportAsync|If set, generate async function call instead| |true|
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|

## IMPORT MAPPING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(RustClientCodegen.class);
private boolean useSingleRequestParameter = false;
private boolean supportAsync = false;
private boolean supportAsync = true;

public static final String PACKAGE_NAME = "packageName";
public static final String PACKAGE_VERSION = "packageVersion";
Expand Down Expand Up @@ -174,7 +174,7 @@ public RustClientCodegen() {
cliOptions.add(new CliOption(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, CodegenConstants.USE_SINGLE_REQUEST_PARAMETER_DESC, SchemaTypeUtil.BOOLEAN_TYPE)
.defaultValue(Boolean.FALSE.toString()));
cliOptions.add(new CliOption(SUPPORT_ASYNC, "If set, generate async function call instead", SchemaTypeUtil.BOOLEAN_TYPE)
.defaultValue(Boolean.FALSE.toString()));
.defaultValue(Boolean.TRUE.toString()));

supportedLibraries.put(HYPER_LIBRARY, "HTTP client: Hyper.");
supportedLibraries.put(REQWEST_LIBRARY, "HTTP client: Reqwest.");
Expand Down