Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7925
Closed
Open
Issue created Nov 12, 2020 by Administrator@rootContributor

[Kotlin] Make ApiClient in jvm-retrofit2 be able to add additional retrofit Converter.Factory

Created by: shanselm-ergon

Description

In our project we use the openapi-generator 5.0.0-beta2 for generating our kotlin client stubs. The ApiClient offers some constructor parameters but I'm missing an option to add an additional retrofit Converter.Factory. I need this option to specify a factory, which serializes a date object as query parameter string (in our custom format, .toString() is not enough for me). In our project we use GSON as serialization library and I couldn't figure out how it is possible to set such a retrofit converter for query parameters with the currently available options.

For testing purposes I extended the generated ApiClient class with an additional constructor parameter to add our specific Converter.Factory and with this change the query parameter could successfully be serialized.

Is there already a possibility to achieve my requested behaviour with the SerializerBuilder I can pass into the class? Or is there a different approach to achieve this? What is your opinion to my described workaround?

Thank you

openapi-generator version

5.0.0-beta2

Suggest a fix/enhancement

Add an option (constructor param) to add custom retrofit converter factories. This should be optional and not break current clients. I could create a pull request with a possible change if you wish.

Assignee
Assign to
Time tracking