Skip to content

Configuration setting to generate model for all schema objects, whether used in a path or not #302

Closed

Description

@tedberg

Currently when generating, the processor scans the path entries and only generates the needed models referenced by the path entries. I created a base project which defines reusable schema objects in a company standard manner. Objects such as Address, ContactInfo, etc. My subprojects import the jar as a dependency and I use maven resources to copy the yaml parts over so their definitions and references are valid. I then use the mapping file in subprojects to point to the packages/objects from the base project.

As a workaround, I created several dummy paths in the base project's openapi.yaml to get the openapi-processor to generate the models. The request is a setting so I can have no paths defined in the base project, yet still generate all model classes.

Activity

  1. hauner commented on Sep 6, 2025

    @hauner
    Member

    Any thoughts how the processor would detect the unused models? Can it assume that the unused models are part of components/schemas ?

  2. tedberg commented on Sep 6, 2025

    @tedberg
    Author

    Yes. I still wanted the folders with individual files, so I settled on a main openapi.yaml like:

    components:
      schemas:
        Address:
          $ref: ...
        ContactInfo:
          $ref: ...
    
  3. added this to the 2025.6 milestone on Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions