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] Gradle plugin produces uncompilable code for GitHub definition file. #20912

Open
sleekweasel opened this issue Mar 17, 2025 · 0 comments
Open

Comments

@sleekweasel
Copy link

sleekweasel commented Mar 17, 2025

Bug Report Checklist

  • [yes] Have you provided a full/minimal spec to reproduce the issue?
  • [ think so ] Have you validated the input using an OpenAPI validator (example)?

The domain has expired. Is this your domain? Renew now

I tried this validator with this cut-down schema and it looked like it was happy, but I'm not an expert.

  • [yes ] Have you tested with the latest master to confirm the issue still exists?
  • [ yes ] Have you searched for related issues/PRs?
  • [ yes ] What's the actual output vs expected output?

Expected: There should be some fields in all kotlin data classes.
Actual: None

Description

Generating the GitHub API schema for Kotlin results in a data class without fields, which doesn't compile. I've extracted and pared down a single endpoint in the gist.

In data.class.mustache, allVars is empty, even though hasVars is true and nonNullableVars, optionalVars, and readWriteVars all contain (in the example Gist) reviewers and teamReviewers.

openapi-generator version

My target version is 7.12.0 but it happens with :latest too, see above.

OpenAPI declaration file content or url

https://gist.githubusercontent.com/sleekweasel/bd91330c7c437d1641a52761d18d8d60/raw/a9fcef66c20938b762944f3d938cbcee1f483fc5/api.chopped.json

Generation Details
$ curl -o https://gist.githubusercontent.com/sleekweasel/bd91330c7c437d1641a52761d18d8d60/raw/a9fcef66c20938b762944f3d938cbcee1f483fc5/api.chopped.json

$ docker run -v $PWD:$PWD  openapitools/openapi-generator-cli:v7.12.0  generate -i api.chopped.json -g kotlin  -o $PWD

$ grep -A2 data src/main/kotlin/org/openapitools/client/models/PullsRequestReviewersRequest.kt
data class PullsRequestReviewersRequest (

) {

Steps to reproduce

See above. There are no entries in data class, which means it won't compile.

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