|
39 | 39 | public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
|
40 | 40 | private static final Logger LOGGER = LoggerFactory.getLogger(RustClientCodegen.class);
|
41 | 41 | private boolean useSingleRequestParameter = false;
|
42 |
| - private boolean supportAsync = false; |
| 42 | + private boolean supportAsync = true; |
43 | 43 |
|
44 | 44 | public static final String PACKAGE_NAME = "packageName";
|
45 | 45 | public static final String PACKAGE_VERSION = "packageVersion";
|
@@ -173,18 +173,18 @@ public RustClientCodegen() {
|
173 | 173 | .defaultValue(Boolean.TRUE.toString()));
|
174 | 174 | cliOptions.add(new CliOption(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, CodegenConstants.USE_SINGLE_REQUEST_PARAMETER_DESC, SchemaTypeUtil.BOOLEAN_TYPE)
|
175 | 175 | .defaultValue(Boolean.FALSE.toString()));
|
176 |
| - cliOptions.add(new CliOption(SUPPORT_ASYNC, "If set, generate async function call instead", SchemaTypeUtil.BOOLEAN_TYPE) |
177 |
| - .defaultValue(Boolean.FALSE.toString())); |
| 176 | + cliOptions.add(new CliOption(SUPPORT_ASYNC, "If set, generate async function call instead. This option is for 'reqwest' library only", SchemaTypeUtil.BOOLEAN_TYPE) |
| 177 | + .defaultValue(Boolean.TRUE.toString())); |
178 | 178 |
|
179 | 179 | supportedLibraries.put(HYPER_LIBRARY, "HTTP client: Hyper.");
|
180 | 180 | supportedLibraries.put(REQWEST_LIBRARY, "HTTP client: Reqwest.");
|
181 | 181 |
|
182 | 182 | CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use.");
|
183 | 183 | libraryOption.setEnum(supportedLibraries);
|
184 |
| - // set hyper as the default |
185 |
| - libraryOption.setDefault(HYPER_LIBRARY); |
| 184 | + // set reqwest as the default |
| 185 | + libraryOption.setDefault(REQWEST_LIBRARY); |
186 | 186 | cliOptions.add(libraryOption);
|
187 |
| - setLibrary(HYPER_LIBRARY); |
| 187 | + setLibrary(REQWEST_LIBRARY); |
188 | 188 | }
|
189 | 189 |
|
190 | 190 | @Override
|
|
0 commit comments