Skip to content

Not generating all fields from class when having children/sibling of same type #442

@runarhk

Description

@runarhk

I have created a simple setup reproducing the where we have a class a that implements an interface A , having a field that has type A .

Steps to Reproduce

  1. Clone supplied repo
  2. run gradle assemble
  3. notice missing fields in type TestImpl1 in generated file at build/classes/java/main/META-INF/swagger/hello-world-0.0.yml

Expected Behaviour

The field name woopsie should be in the TestImpl1 type with type: $ref: '#/components/schemas/TestImpl1'

Actual Behaviour

The field woopsie is missing entirely. This is also the case for lists of same type.

For some reason adding a generic type to the interface, like so: TestInterface<T> resolves the issue.

Environment Information

  • Operating System: Linux Mint 20 Cinnamon
  • Micronaut Version: 2.2.1
  • JDK Version: openjdk 14.0.2 2020-07-14

Example Application

https://github.com/runarhk/micronaut-open-api-missing-field

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions