forked from loafle/openapi-generator-original
Make the Rust codegen compile. (#6411)
* Use the right package name for the Rust crate. * Change getters on models to return Option for non-required fields. * Cleanup Rust generation and get example compiling again. * Use underscore names for functions.
This commit is contained in:
@@ -325,11 +325,11 @@ public class RustClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
// method name cannot use reserved keyword, e.g. return
|
||||
if (isReservedWord(sanitizedOperationId)) {
|
||||
LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize("call_" + operationId));
|
||||
LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore("call_" + operationId));
|
||||
sanitizedOperationId = "call_" + sanitizedOperationId;
|
||||
}
|
||||
|
||||
return camelize(sanitizedOperationId);
|
||||
return underscore(sanitizedOperationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user