Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

does not generate model class if it is only referenced in a type mapping #50

Closed
hauner opened this issue Dec 10, 2020 · 0 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@hauner
Copy link
Member

hauner commented Dec 10, 2020

Having an openapi description with a model schema that is not directly referenced anymore after considering the mappings, is not generated even if it still referenced by a mapping.

This can happen if the there is a paged response that is mapped to the Spring framework Page class and there is no other endpoint that uses the page content type.

map:
  types:
    - type: FooPage => org.springframework.data.domain.Page<generated.model.Foo>

The details of the mapped openapi schema (which describes the page response in this case) are not considered anymore. It is replaced by the mapping so there is no need to generate the page content type.

The processor should recognize that the type is used and should generate the type.

Workaround:

a possible workaround is to create a dummy schema under components.schemas that references the missing type.

@hauner hauner added the bug Something isn't working label Dec 10, 2020
@hauner hauner closed this as completed in 16fe0be Jan 10, 2021
@hauner hauner added this to the 2021.1 milestone Feb 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant