Skip to content

Conversation

@ty-v1
Copy link
Contributor

@ty-v1 ty-v1 commented Mar 24, 2022

resolve #11824

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.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    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
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Description of the PR

I added TypeScriptNodeClientCodegen#removeModelPrefixSuffix to remove prefix/suffix defined by --model-name-prefix|suffix options.

And I added unit tests.

Related issue and PR

#2590
#2560

@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03)

@macjohnny macjohnny merged commit 7cc995a into OpenAPITools:master Mar 24, 2022
@wing328
Copy link
Member

wing328 commented Mar 24, 2022

Looks like this causes compilation errors in the master:

[ERROR] COMPILATION ERROR : 
[ERROR] /home/travis/build/OpenAPITools/openapi-generator/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java:[183,52] no suitable method found for postProcessAllModels(java.util.HashMap<java.lang.String,java.lang.Object>)
    method org.openapitools.codegen.DefaultCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
      (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
    method org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
      (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
    method org.openapitools.codegen.languages.TypeScriptNodeClientCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
      (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
[ERROR] /home/travis/build/OpenAPITools/openapi-generator/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java:[212,52] no suitable method found for postProcessAllModels(java.util.HashMap<java.lang.String,java.lang.Object>)
    method org.openapitools.codegen.DefaultCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
      (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
    method org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
      (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
    method org.openapitools.codegen.languages.TypeScriptNodeClientCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
      (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.0:testCompile (default-testCompile) on project openapi-generator: Compilation failure: Compilation failure: 
[ERROR] /home/travis/build/OpenAPITools/openapi-generator/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java:[183,52] no suitable method found for postProcessAllModels(java.util.HashMap<java.lang.String,java.lang.Object>)
[ERROR]     method org.openapitools.codegen.DefaultCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
[ERROR]       (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
[ERROR]     method org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
[ERROR]       (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)
[ERROR]     method org.openapitools.codegen.languages.TypeScriptNodeClientCodegen.postProcessAllModels(java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>) is not applicable
[ERROR]       (argument mismatch; java.util.HashMap<java.lang.String,java.lang.Object> cannot be converted to java.util.Map<java.lang.String,org.openapitools.codegen.model.ModelsMap>)

ref: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/248394151

ref: https://app.circleci.com/pipelines/github/OpenAPITools/openapi-generator/16458/workflows/f1ea2d29-eb63-4495-b2c1-6d885f58aba5

@macjohnny
Copy link
Member

Reverted in #11963

@ty-v1 can you check what was the issue?

@ty-v1
Copy link
Contributor Author

ty-v1 commented Mar 25, 2022

Reverted in #11963

@ty-v1 can you check what was the issue?

Yes. I'll submit PR as soon as possible.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][typescript-node] Incorrect import path when using prefix/suffix for model names

3 participants