Skip to content

Conversation

@kuFEAR
Copy link
Contributor

@kuFEAR kuFEAR commented Mar 29, 2020

Added supporting Retrofit2(RxJava/RxJava2/Coroutines) for Kotlin client code generator

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@jimschubert @dr4ke616 @karismann @Zomzog @andrewemery @4brunu

@kuFEAR kuFEAR requested a review from jimschubert as a code owner March 29, 2020 22:08
@kuFEAR kuFEAR changed the title Added supporting Retrofit2(RxJava/RxJava2/Coroutines) for Kotlin client [Kotlin][Client] Added supporting Retrofit2(RxJava/RxJava2/Coroutines) Mar 31, 2020
@wing328
Copy link
Member

wing328 commented Apr 2, 2020

Please merge the latest master into this branch to resolve the CircleCI failure.

@kuFEAR
Copy link
Contributor Author

kuFEAR commented Apr 2, 2020

hm, merge is not helped

: Serializable

{
) : kotlin.mapOf<String, kotlin.Any>, Serializable {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like broken for generics somewhere before my changes

@4brunu
Copy link
Contributor

4brunu commented Apr 3, 2020

Currently we have two open PR that implement coroutines support.
#5697
@wing328 could you please help with this? How should we handle this?

@kuFEAR
Copy link
Contributor Author

kuFEAR commented May 12, 2020

#5600 Fixed encoding from 3. using {{{parent}}}

@kuFEAR
Copy link
Contributor Author

kuFEAR commented May 12, 2020

  1. [FIXED]
    I fixed adding empty braces for inheritance from map/array by {{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}, I don't know is correct approach or not, but it works)

{{#moshi}}
@Json(name = "{{{vendorExtensions.x-base-name-literal}}}")
{{/moshi}}
{{#gson}}
Copy link
Contributor

Choose a reason for hiding this comment

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

@kuFEAR Why did you remove gson from here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gson @SerializedName target only for method and fields
@target({ElementType.FIELD, ElementType.METHOD}) and Kotlin interface fields is not yet determined as field by kotlin compiler, I saw error message there
Screenshot 2020-05-12 at 12 20 06

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks

{{#moshi}}
@Json(name = "{{{vendorExtensions.x-base-name-literal}}}")
{{/moshi}}
{{#gson}}
Copy link
Contributor

Choose a reason for hiding this comment

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

@kuFEAR same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have an idea add @get:SerializedName("field")

Copy link
Contributor

Choose a reason for hiding this comment

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

If that works, it would be nice, because I use Gson on my projects

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks

@kuFEAR
Copy link
Contributor Author

kuFEAR commented May 13, 2020

[main] ERROR org.openapitools.codegen.languages.MysqlSchemaCodegen - Invalid database name. '12345' cannot be used as MySQL identifier. Escaped value '12345_db' will be used instead.
[main] ERROR org.openapitools.codegen.DefaultCodegen - `null` (map property) does not have a proper inner type defined. Default to type:string
[main] ERROR org.openapitools.codegen.DefaultCodegen - ERROR! Not handling  class QueryParameter {
    class Parameter {
        name: limit
        in: null
        description: this is a description
        required: true
        deprecated: null
        allowEmptyValue: null
        style: null
        explode: null
        allowReserved: null
        schema: null
        examples: null
        example: null
        content: null
        $ref: null
    }
    in: query
} as Body Parameter at the moment
[main] ERROR org.openapitools.codegen.DefaultCodegen - `null` (map property) does not have a proper inner type defined. Default to type:string
[main] ERROR org.openapitools.codegen.DefaultCodegen - body in fromRequestBody cannot be null!
[main] ERROR org.openapitools.codegen.utils.ModelUtils - Schema cannot be null in isFreeFormObject check
[main] ERROR o.o.c.config.CodegenConfigurator - Unexpected character ('-' (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value
 at [Source: (File); line: 1, column: 3]
[main] ERROR o.o.c.config.CodegenConfigurator - Unexpected character ('-' (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value
 at [Source: (File); line: 1, column: 3]
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (test) on project PythonFlaskConnexionTests: Command execution failed. Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :PythonFlaskConnexionTests

This error is related to my PR?

@4brunu
Copy link
Contributor

4brunu commented May 13, 2020

I don't think so, it seems to be related to python, and the master branch was failing with the same error.

@kuFEAR
Copy link
Contributor Author

kuFEAR commented May 13, 2020

I don't think so, it seems to be related to python, and the master branch was failing with the same error.

ok, thanks

@wing328
Copy link
Member

wing328 commented May 13, 2020

The issue has been fixed in the master. Please merge the latest master into this branch to fix the issue.

@kuFEAR
Copy link
Contributor Author

kuFEAR commented May 13, 2020

now it fails on sudo apt-get install elixir

@wing328
Copy link
Member

wing328 commented May 14, 2020

Restarted the CI job. Let's see how it goes.

@wing328
Copy link
Member

wing328 commented May 18, 2020

Tested the kotlin retrofit2 samples and no longer encounter the issue.

@wing328 wing328 merged commit eefcd62 into OpenAPITools:master May 18, 2020
@wing328 wing328 mentioned this pull request May 20, 2020
5 tasks
@kuFEAR kuFEAR deleted the kotlin-rx-rx2-coroutines branch May 23, 2020 11:01
@wing328 wing328 added this to the 5.0.0 milestone Jul 3, 2020
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.

4 participants