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
  • #3004
Closed
Open
Issue created May 26, 2019 by Administrator@rootContributor3 of 3 checklist items completed3/3 checklist items

[BUG][Kotlin-Client] Moshi (Serializer/Deserializer) Configuration duplicated in generated code/template

Created by: lemoinem

Bug Report Checklist

  • What's the version of OpenAPI Generator used? master
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

In Kotlin client generated code, the Serialization/Deserialization library's config is duplicated: Once in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache#L65-L72

And once in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/Serializer.kt.mustache which is used at https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache#L49

I believe it would be much easier both for modularity (e.g., https://github.com/OpenAPITools/openapi-generator/issues/2418) and for code maintenance, if the Configuration was in a single place.

Is this something you'd be open to accept a PR about it.

openapi-generator version

master

OpenAPI declaration file content or url

N/A

Command line used for generation

N/A

Steps to reproduce

N/A

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/2418

Suggest a fix

Simply use Serializer.moshi instead of duplicating the code in responseBody.

Assignee
Assign to
Time tracking