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][SCALA-AKKA] Doesn't generate models when defined inline (reproduced for java & scala-akka) #8966

Open
5 of 6 tasks
Coder-DG opened this issue Mar 13, 2021 · 3 comments

Comments

@Coder-DG
Copy link

Coder-DG commented Mar 13, 2021

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? No models generated vs models generated
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Running java -jar openapi-generator-cli.jar generate -i 'swagger.json' -g scala-akka -o scala_client --generate-alias-as-model (also without config and/or without --generate-alias-as-model), doesn't produce any model libs.

Removing "additionalProperties": false, from the inline schema def makes it generate model classes. What also works is to define the schema using definitions + "$ref" : "..." - but that's not really feasible with the library I'm using for my server.

openapi-generator version

5.0.1 and also tested with openapi-generator-cli-5.1.0-20210304.083949-99.jar

OpenAPI declaration file content or url

swagger.json gist

Generation Details

X

Steps to reproduce

Just run java -jar openapi-generator-cli.jar generate -i 'swagger.json' -g scala-akka -o scala_client where swagger.json is the file I linked above, and the jar is either 5.0.1 or the snapshot version I mentioned.

Related issues/PRs

X

Suggest a fix

Somehow removing "additionalProperties": false, from the inline schema def makes it generate model classes. Setting it to true doesn't help either (not sure true is valid though). Referencing it with "$ref": "..." and moving the schema to definitions also solves this (but I can't use that solution due to the. lib I'm using).

@auto-labeler
Copy link

auto-labeler bot commented Mar 13, 2021

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@Coder-DG
Copy link
Author

This isn't specific to Scala, this happens with Java as well.

@Coder-DG
Copy link
Author

A workaround: https://stackoverflow.com/a/67278207/12845862

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