question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Any isSomething field is serialized incorrectly in Kotlin generator

See original GitHub issue

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?

  • Have you validated the input using an OpenAPI validator (example)?

  • What’s the version of OpenAPI Generator used? openapi: 3.0.1

  • Have you search for related issues/PRs? yes

  • What’s the actual output vs expected output? expected - it will generate correct API actual output is

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 1, Warning count: 1
Errors: 
        -attribute paths.'/v1/{uuid}'.[['unknown']].in is missing
Warnings: 
        -attribute paths.'/v1/{uuid}'.[['unknown']].in is missing

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:480)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:507)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:423)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)
  • [Optional] Bounty to sponsor the fix (example)
Description
openapi-generator version

openapi: 3.0.1

OpenAPI declaration file content or url

https://gist.github.com/mishin/31fc9ae2b0d4acd79fc668fded257c41

Command line used for generation
./gradlew  'generate all'
openapi-generator-cli generate -g kotlin -i /src/main/resources/openapi/api.yaml -o /var/tmp/kotlin3/

return

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 1, Warning count: 1
Errors: 
        -attribute paths.'/v1/{uuid}'.[['unknown']].in is missing
Warnings: 
        -attribute paths.'/v1/{uuid}'.[['unknown']].in is missing

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:480)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:507)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:423)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)
Steps to reproduce
Related issues/PRs
Suggest a fix

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
auto-labeler[bot]commented, Jun 10, 2020

👍 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.

0reactions
mishincommented, Jun 28, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

kotlinx.serialization.MissingFieldException: Error in kotlin
Looks that some of the items in your JSON doesn't contain the words field and since you don't accept the val words: List<CommonWords>...
Read more >
Groovy Language Documentation
2.5. groovydoc, the Groovy & Java documentation generator ... Any indentation would yield a compilation error. ... Incorrect computation result.
Read more >
Management & Monitoring - Micronaut Documentation
Introspections on fields are not possible in Kotlin because it is not possible to declare fields directly. Constructor Methods. For classes with multiple ......
Read more >
MessagePack: It's like JSON. but fast and small.
MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller.
Read more >
userguide.pdf - Gradle User Manual
if you're given a Gradle build without any instructions? ... See the full compatibility notes for Java, Groovy, Kotlin and Android.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found