Skip to content
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

[General] Remove defunct global property withXml from generator, docs, maven & gradle plugin #18568

Merged
merged 15 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-wit
library: microprofile
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
withXml: true
additionalProperties:
serializationLibrary: jackson
artifactId: microprofile-rest-client-3-jackson-with-xml
configKey: petstore
microprofileRestClientVersion: "3.0"
hideGenerationTimestamp: true
withXml: true
33 changes: 16 additions & 17 deletions docs/global-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@ title: Global Properties

## Available Global Properties

| Property | Description | Acceptable value |
| -------- | ------------| ---------------- |
| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none |
| debugModels | Dumps JSON formatted template-bound model information during generation | none |
| debugOperations | Dumps JSON formatted template-bound operation information during generation | none |
| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none |
| verbose | Defines the verbosity | `true` or `false` |
| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` |
| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` |
| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of file names |
| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of model names |
| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of api names |
| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| withXml | Allows the user to control support of XML generated constructs, where supported | none |
| Property | Description | Acceptable value |
|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none |
| debugModels | Dumps JSON formatted template-bound model information during generation | none |
| debugOperations | Dumps JSON formatted template-bound operation information during generation | none |
| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none |
| verbose | Defines the verbosity | `true` or `false` |
| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` |
| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` |
| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of file names |
| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of model names |
| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of api names |
| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |


## Note on Global Property declaration
Expand Down
5 changes: 0 additions & 5 deletions modules/openapi-generator-gradle-plugin/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,6 @@ apply plugin: 'org.openapi.generator'
|true
|Defines whether or not api-related _documentation_ files should be generated.

|withXml
|Boolean
|false
|A special-case setting which configures some generators with XML support. In some cases, this forces json OR xml, so the default here is false.

|configOptions
|Map(String,String)
|None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
generateModelDocumentation.set(generate.generateModelDocumentation)
generateApiTests.set(generate.generateApiTests)
generateApiDocumentation.set(generate.generateApiDocumentation)
withXml.set(generate.withXml)
configOptions.set(generate.configOptions)
logToStderr.set(generate.logToStderr)
enablePostProcessFile.set(generate.enablePostProcessFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
*/
val generateApiDocumentation = project.objects.property<Boolean>()

/**
* A special-case setting which configures some generators with XML support. In some cases,
* this forces json OR xml, so the default here is false.
*/
val withXml = project.objects.property<Boolean>()

/**
* To write all log messages (not just errors) to STDOUT
*/
Expand Down Expand Up @@ -408,7 +402,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
generateModelDocumentation.set(true)
generateApiTests.set(true)
generateApiDocumentation.set(true)
withXml.set(false)
configOptions.set(mapOf())
validateSpec.set(true)
logToStderr.set(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@Input
val generateApiDocumentation = project.objects.property<Boolean>()

/**
* A special-case setting which configures some generators with XML support. In some cases,
* this forces json OR xml, so the default here is false.
*/
@Optional
@Input
val withXml = project.objects.property<Boolean>()

/**
* To write all log messages (not just errors) to STDOUT
*/
Expand Down Expand Up @@ -680,10 +672,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.get().toString())
}

if (withXml.isPresent) {
GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.get().toString())
}

if (inputSpec.isPresent && remoteInputSpec.isPresent) {
logger.warn("Both inputSpec and remoteInputSpec is specified. The remoteInputSpec will take priority over inputSpec.")
}
Expand Down
1 change: 0 additions & 1 deletion modules/openapi-generator-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ mvn clean compile
| `generateModelDocumentation` | `openapi.generator.maven.plugin.generateModelDocumentation` | generate the model documentation (`true` by default. Only available if `generateModels` is `true`)
| `generateApiTests` | `openapi.generator.maven.plugin.generateApiTests` | generate the api tests (`true` by default. Only available if `generateApis` is `true`)
| `generateApiDocumentation` | `openapi.generator.maven.plugin.generateApiDocumentation` | generate the api documentation (`true` by default. Only available if `generateApis` is `true`)
| `withXml` | `openapi.generator.maven.plugin.withXml` | enable XML annotations inside the generated models and API (only works with Java `language` and libraries that provide support for JSON and XML)
| `skip` | `codegen.skip` | skip code generation (`false` by default. Can also be set globally through the `codegen.skip` property)
| `skipIfSpecIsUnchanged` | `codegen.skipIfSpecIsUnchanged` | Skip the execution if the source file is older than the output folder (`false` by default. Can also be set globally through the `codegen.skipIfSpecIsUnchanged` property)
| `addCompileSourceRoot` | `openapi.generator.maven.plugin.addCompileSourceRoot` | Add the output directory to the project as a source root, so that the generated java types are compiled and included in the project artifact (`true` by default). Mutually exclusive with `addTestCompileSourceRoot`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,6 @@ public class CodeGenMojo extends AbstractMojo {
@Parameter(name = "generateApiDocumentation", property = "openapi.generator.maven.plugin.generateApiDocumentation")
private Boolean generateApiDocumentation = true;

/**
* Generate the api documentation
*/
@Parameter(name = "withXml", property = "openapi.generator.maven.plugin.withXml")
private Boolean withXml = false;

/**
* Skip the execution.
*/
Expand Down Expand Up @@ -811,7 +805,6 @@ public void execute() throws MojoExecutionException {
GlobalSettings.setProperty(CodegenConstants.MODEL_DOCS, generateModelDocumentation.toString());
GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.toString());
GlobalSettings.setProperty(CodegenConstants.API_DOCS, generateApiDocumentation.toString());
GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.toString());
GlobalSettings.setProperty(CodegenConstants.GENERATE_RECURSIVE_DEPENDENT_MODELS, generateRecursiveDependentModels.toString());

if (configOptions != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class CodegenConstants {
public static final String API_TESTS = "apiTests";
public static final String API_DOCS = "apiDocs";

public static final String WITH_XML = "withXml";
public static final String SKIP_FORM_MODEL = "skipFormModel";
/* /end System Properties */

Expand Down Expand Up @@ -438,6 +437,8 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,

public static final String FASTAPI_IMPLEMENTATION_PACKAGE = "fastapiImplementationPackage";

public static final String WITH_XML = "withXml";

public static final String WITH_GO_MOD = "withGoMod";

public static final String GENERATE_MARSHAL_JSON = "generateMarshalJSON";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ Class | Method | HTTP request | Description
- modelDocs: {{generateModelDocs}}
- apiTests: {{generateApiTests}}
- modelTests: {{generateModelTests}}
- withXml: {{withXml}}

## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore)
- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}}
Expand Down
Loading