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

[BUG] [KOTLIN] moshiCodeGen unable to handle additionalProperties: true #20137

Open
5 of 6 tasks
ben-robinson-simplisafe opened this issue Nov 19, 2024 · 0 comments
Open
5 of 6 tasks

Comments

@ben-robinson-simplisafe

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When using moshiCodeGen, and additionalProperties is set to true in the spec: additionalProperties: true, we are unable to successfully generate models.

Error preparing GetMessages200Response: com.squareup.moshi.kotlin.codegen.ksp.AppliedType.superclasses(AppliedType.kt:46)

openapi-generator version

Using 7.10.0. I don't believe its a regression.

OpenAPI declaration file content or url
      responses:
        "200":
          description: "Successful response"
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  messages:
                    description: "Description"
                    nullable: false
                    type: array
                    items:
                      $ref: "#/components/schemas/Message"
Generation Details

Using the Kotlin generator with the gradle Plugin in an Android environment.

Steps to reproduce
  1. Add additionalProperties: true to a model in your spec
  2. Set moshiCodeGen to true
        additionalProperties.set(
            mapOf(
                Pair("moshiCodeGen", "true")
            )
        )
Related issues/PRs
Suggest a fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant