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

Fix Rust codegen for AnyType #7461

Merged
merged 1 commit into from
Sep 21, 2020

Conversation

aidanhs
Copy link
Contributor

@aidanhs aidanhs commented Sep 20, 2020

Simply adds a type for AnyType for Rust codegen. I can see that this is present for other languages, so is really just filling a missing piece:

$ rg '"AnyType"'
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
1451:        typeMapping.put("AnyType", "oas_any_type_not_mapped");
2082:            return "AnyType";

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java
130:        typeMapping.put("AnyType", "mixed");

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
178:        typeMapping.put("AnyType", "Object");

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java
173:        typeMapping.put("AnyType", "any");
896:            ? schemas.stream().filter(schema -> !"AnyType".equals(super.getSchemaType(schema))).collect(Collectors.toList())

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java
92:        typeMapping.put("AnyType", "Object");

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java
133:        typeMapping.put("AnyType", "interface{}");

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java
214:        typeMapping.put("AnyType", "serde_json::Value");

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
138:        typeMapping.put("AnyType", "object");

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java
142:        typeMapping.put("AnyType", "Object");

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

cc @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05)

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aidanhs thanks for the PR, which looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants