Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Generator refactoring #425

Merged
merged 44 commits into from
Apr 19, 2024
Merged

Generator refactoring #425

merged 44 commits into from
Apr 19, 2024

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Apr 13, 2024

There were 100+ methods in the interface Generator.java
This PR separates out functionality into an OpenApiProcessor interface for methods that process openapi objects and leaves the remaining needed method in the Generator interface. More of these methods can definitely be removed in the future, I just deprecated the easiest ones.
The remaining methods in the generator interface were examined and refactored to reduce the number of methods

Generator refactoring

  • deprecates generator methods that are unneeded
  • updated generatorMetadata class to hold more information
  • adds a new generatorSettings class
  • passes needed generator inputs into the generator constructor and creates an instance of the generator settings class

Command Line Arg Adjustments

  • adds --remove-enum-value-prefix and --hide-generation-timestamp generate arguments
  • artifactId + hideGenerationTimestamp + packageName + templatingEngine all removed from additional property args because they are already present as generate args. For the rest of this major version, they are still accepted as additionalProperties args, and LOGGER.warn messages mention that they should be moved from now on

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    mvn clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/generate_samples_configs/python*
    For Windows users, please run the script in Git BASH.

@spacether spacether force-pushed the generator_refactoring branch from a9a4e93 to 3abf681 Compare April 17, 2024 23:50
@spacether spacether merged commit 9b468b3 into master Apr 19, 2024
5 checks passed
@spacether spacether deleted the generator_refactoring branch April 19, 2024 23:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant