-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[MAVEN PLUGIN; GRADLE-PLUGIN] - Add KDoc/Javadoc to the Gradle plugin and integrate Dokka so IDEs show helpful tooltips; fix missing parameter wiring; improve merged-spec handling to match the Maven plugin #24067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Picazsoo
wants to merge
14
commits into
OpenAPITools:master
Choose a base branch
from
Picazsoo:feature/add-javadoc-and-kdoc-to-gradle-wrapper
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
61ffdbb
docs: add Javadoc and KDoc comments to Gradle wrapper configuration
Picazsoo 501ec24
docs: add Javadoc and KDoc comments to Gradle wrapper configuration
Picazsoo 3c166b0
fix(gradle-plugin): add KDoc/Javadoc tooling and fix parameter gaps
Picazsoo 3d85666
add tests
Picazsoo 8a0f1bb
implement CR feedback
Picazsoo 0386162
Revert "implement CR feedback"
Picazsoo 030b0d0
Reapply "implement CR feedback"
Picazsoo c2f474f
add missing properties to extension
Picazsoo efb715a
fix javadoc inclusion
Picazsoo d38e561
fix CR suggestions
Picazsoo ba8bbfb
add javadoc and kdoc generation to Gradle wrapper
Picazsoo b32f22c
fix incorrect usage of Optional on Internal gradle property
Picazsoo 1311704
fix after build failure
Picazsoo c46500e
update dokka to latest stable version
Picazsoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -38,6 +38,7 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
|
|
||||||
| /** | ||||||
| * Whether an input specification should be validated upon generation. | ||||||
| * Defaults to `true`. | ||||||
| */ | ||||||
| val validateSpec = project.objects.property<Boolean>() | ||||||
|
|
||||||
|
|
@@ -75,6 +76,30 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| */ | ||||||
| val inputSpecRootDirectorySkipMerge = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * The name of the merged spec file produced when [inputSpecRootDirectory] is used. | ||||||
| * Defaults to `"merged"`. | ||||||
| */ | ||||||
| val mergedFileName = project.objects.property<String>() | ||||||
|
|
||||||
| /** | ||||||
| * Title placed in the `info.title` field of the merged spec. Defaults to `"merged spec"`. | ||||||
| * Only used when [inputSpecRootDirectory] is set. | ||||||
| */ | ||||||
| val mergedFileInfoName = project.objects.property<String>() | ||||||
|
|
||||||
| /** | ||||||
| * Description placed in the `info.description` field of the merged spec. Defaults to `"merged spec"`. | ||||||
| * Only used when [inputSpecRootDirectory] is set. | ||||||
| */ | ||||||
| val mergedFileInfoDescription = project.objects.property<String>() | ||||||
|
|
||||||
| /** | ||||||
| * Version placed in the `info.version` field of the merged spec. Defaults to `"1.0.0"`. | ||||||
| * Only used when [inputSpecRootDirectory] is set. | ||||||
| */ | ||||||
| val mergedFileInfoVersion = project.objects.property<String>() | ||||||
|
|
||||||
| /** | ||||||
| * The remote Open API 2.0/3.x specification URL location. | ||||||
| */ | ||||||
|
|
@@ -189,7 +214,11 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| val inlineSchemaNameMappings = project.objects.mapProperty<String, String>() | ||||||
|
|
||||||
| /** | ||||||
| * Specifies options for inline schemas | ||||||
| * Key/value options controlling how inline schemas are handled during generation. | ||||||
| * | ||||||
| * Common keys: `RESOLVE_INLINE_ENUMS` (promote inline enums to top-level models), | ||||||
| * `ARRAY_ITEMS_SUFFIX`, `MAP_ITEMS_SUFFIX`. Run `config-help -g {generatorName}` for the | ||||||
| * full list of supported options. | ||||||
| */ | ||||||
| val inlineSchemaOptions = project.objects.mapProperty<String, String>() | ||||||
|
|
||||||
|
|
@@ -219,7 +248,12 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| val operationIdNameMappings = project.objects.mapProperty<String, String>() | ||||||
|
|
||||||
| /** | ||||||
| * Specifies mappings (rules) in OpenAPI normalizer | ||||||
| * Key/value rules passed to the OpenAPI normalizer, which pre-processes the parsed spec | ||||||
| * before code generation begins. | ||||||
| * | ||||||
| * Example rules: `REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true`, | ||||||
| * `REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY=true`. See the OpenAPI Generator docs for | ||||||
| * the full list of normalizer rules. | ||||||
| */ | ||||||
| val openapiNormalizer = project.objects.mapProperty<String, String>() | ||||||
|
|
||||||
|
|
@@ -330,6 +364,7 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| * | ||||||
| * For more control over generation of individual files, configure an ignore file and | ||||||
| * refer to it via [ignoreFileOverride]. | ||||||
| * Defaults to `true`. | ||||||
| */ | ||||||
| val generateModelTests = project.objects.property<Boolean>() | ||||||
|
|
||||||
|
|
@@ -340,6 +375,7 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| * | ||||||
| * For more control over generation of individual files, configure an ignore file and | ||||||
| * refer to it via [ignoreFileOverride]. | ||||||
| * Defaults to `true`. | ||||||
| */ | ||||||
| val generateModelDocumentation = project.objects.property<Boolean>() | ||||||
|
|
||||||
|
|
@@ -350,6 +386,7 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| * | ||||||
| * For more control over generation of individual files, configure an ignore file and | ||||||
| * refer to it via [ignoreFileOverride]. | ||||||
| * Defaults to `true`. | ||||||
| */ | ||||||
| val generateApiTests = project.objects.property<Boolean>() | ||||||
|
|
||||||
|
|
@@ -360,11 +397,12 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| * | ||||||
| * For more control over generation of individual files, configure an ignore file and | ||||||
| * refer to it via [ignoreFileOverride]. | ||||||
| * Defaults to `true`. | ||||||
| */ | ||||||
| val generateApiDocumentation = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * To write all log messages (not just errors) to STDOUT | ||||||
| * To write all log messages (not just errors) to STDOUT. Defaults to `false`. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: KDoc contradicts property semantics: Prompt for AI agents
Suggested change
|
||||||
| */ | ||||||
| val logToStderr = project.objects.property<Boolean>() | ||||||
|
|
||||||
|
|
@@ -373,18 +411,21 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| * This only enables the post-processor. To define the post-processing command, define an environment variable such as | ||||||
| * LANG_POST_PROCESS_FILE (e.g. GO_POST_PROCESS_FILE, SCALA_POST_PROCESS_FILE). Please open an issue if your target | ||||||
| * generator does not support this functionality. | ||||||
| * Defaults to `false`. | ||||||
| */ | ||||||
| val enablePostProcessFile = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * To skip spec validation. When true, we will skip the default behavior of validating a spec before generation. | ||||||
| * Defaults to `false`. | ||||||
| */ | ||||||
| val skipValidateSpec = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * To generate alias (array, list, map) as model. When false, top-level objects defined as array, list, or map will result in those | ||||||
| * definitions generated as top-level Array-of-items, List-of-items, Map-of-items definitions. | ||||||
| * When true, A model representation either containing or extending the array,list,map (depending on specific generator implementation) will be generated. | ||||||
| * Defaults to `false`. | ||||||
| */ | ||||||
| val generateAliasAsModel = project.objects.property<Boolean>() | ||||||
|
|
||||||
|
|
@@ -400,15 +441,37 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
|
|
||||||
| /** | ||||||
| * Defines whether the output dir should be cleaned up before generating the output. | ||||||
| * | ||||||
| * Defaults to `false`. | ||||||
| */ | ||||||
| val cleanupOutput = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * Defines whether the generator should run in dry-run mode. | ||||||
| * Defaults to `false`. | ||||||
| */ | ||||||
| val dryRun = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * When `true`, applies strict validation against the OpenAPI specification, failing on any deviation. | ||||||
| * When not set, any value from [configFile] is used; the generator's own default is `false`. | ||||||
| */ | ||||||
| val strictSpec = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * When `true`, only writes output files that have changed relative to an existing generated output. | ||||||
| * Reduces unnecessary file churn in version control. | ||||||
| * When not set, any value from [configFile] is used; the generator's own default is `false`. | ||||||
| */ | ||||||
| val minimalUpdate = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * When `true`, recursively generates all models that the selected models depend on, | ||||||
| * even if those dependent models were not explicitly listed for generation. | ||||||
| * Only relevant when [modelFilesConstrainedTo] is configured. | ||||||
| * When not set, any value from [configFile] is used; the generator's own default is `false`. | ||||||
| */ | ||||||
| val generateRecursiveDependentModels = project.objects.property<Boolean>() | ||||||
|
|
||||||
| /** | ||||||
| * Controls how the code generation worker is isolated from the Gradle daemon. | ||||||
| * | ||||||
|
|
@@ -439,6 +502,7 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| fun applyDefaults() { | ||||||
| releaseNote.convention("Minor update") | ||||||
| inputSpecRootDirectorySkipMerge.convention(false) | ||||||
| mergedFileName.convention("merged") | ||||||
| modelNamePrefix.convention("") | ||||||
| modelNameSuffix.convention("") | ||||||
| apiNameSuffix.convention("") | ||||||
|
|
@@ -454,6 +518,13 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) { | |||||
| generateAliasAsModel.convention(false) | ||||||
| cleanupOutput.convention(false) | ||||||
| dryRun.convention(false) | ||||||
| mergedFileInfoName.convention("merged spec") | ||||||
| mergedFileInfoDescription.convention("merged spec") | ||||||
| mergedFileInfoVersion.convention("1.0.0") | ||||||
| // No convention for strictSpec/minimalUpdate/generateRecursiveDependentModels: | ||||||
| // the worker uses orNull?.let to skip calling the configurator when these are unset, | ||||||
| // allowing config-file values to win. A convention(false) would make orNull always | ||||||
| // return false and unconditionally override any config-file setting. | ||||||
| } | ||||||
|
|
||||||
| // ======================================================================== | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.