Add support for controlling output of OpenAPI Generator version in generated files (#17952)

* add initial openapi config and java generated files

* add java implementation for adding generator version

* regenerate sample client files

* remove tabs

* only show generated version if build info exists

* set build info for batch generation

* update generator doc for new global flag

* use existing property for generator version

* update templates to include generator version

* update templates for better generator version syntax

* revert undesired changes

* regenerate samples for openapi client

* update templates to correct formatting/newlines

* correct description text and add to usage doc

* add generator cli option for all codegen types

* use more concise version info; update existing codegens to support new prop

* correct wrong prop reference

* add initial test coverage for new prop

* update last (scala) templates with new prop

* update samples after upstream merge

* use consistent version output

* use better sample project id/name

* revert using option for generator version in templates
This commit is contained in:
Ross Bender
2024-03-09 01:52:08 -06:00
committed by GitHub
parent c87ad561f1
commit cf2435f335
5612 changed files with 34853 additions and 5131 deletions

View File

@@ -18,7 +18,7 @@ import org.openapitools.client.auth.HttpBearerAuth;
import org.openapitools.client.auth.ApiKeyAuth;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class ApiClient {
private static final Logger log = Logger.getLogger(ApiClient.class.getName());

View File

@@ -16,7 +16,7 @@ package org.openapitools.client;
import java.util.Collection;
import java.util.Iterator;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).

View File

@@ -11,7 +11,7 @@ import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public interface AuthApi extends ApiClient.Api {

View File

@@ -15,7 +15,7 @@ import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public interface BodyApi extends ApiClient.Api {

View File

@@ -11,7 +11,7 @@ import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public interface FormApi extends ApiClient.Api {

View File

@@ -12,7 +12,7 @@ import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public interface HeaderApi extends ApiClient.Api {

View File

@@ -12,7 +12,7 @@ import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public interface PathApi extends ApiClient.Api {

View File

@@ -18,7 +18,7 @@ import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public interface QueryApi extends ApiClient.Api {

View File

@@ -25,7 +25,7 @@ import java.io.IOException;
/**
* Bird
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class Bird {
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)

View File

@@ -25,7 +25,7 @@ import java.io.IOException;
/**
* Category
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class Category {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)

View File

@@ -30,7 +30,7 @@ import org.openapitools.client.model.Query;
/**
* DataQuery
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class DataQuery extends Query {
public static final String SERIALIZED_NAME_SUFFIX = "suffix";
@SerializedName(SERIALIZED_NAME_SUFFIX)

View File

@@ -30,7 +30,7 @@ import org.openapitools.jackson.nullable.JsonNullable;
/**
* to test the default value of properties
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING_ENUM_REF_DEFAULT = "array_string_enum_ref_default";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_ENUM_REF_DEFAULT)

View File

@@ -26,7 +26,7 @@ import java.math.BigDecimal;
/**
* NumberPropertiesOnly
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class NumberPropertiesOnly {
public static final String SERIALIZED_NAME_NUMBER = "number";
@SerializedName(SERIALIZED_NAME_NUMBER)

View File

@@ -30,7 +30,7 @@ import org.openapitools.client.model.Tag;
/**
* Pet
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class Pet {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)

View File

@@ -28,7 +28,7 @@ import java.util.List;
/**
* Query
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class Query {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)

View File

@@ -25,7 +25,7 @@ import java.io.IOException;
/**
* Tag
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class Tag {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)

View File

@@ -25,7 +25,7 @@ import java.io.IOException;
/**
* TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter {
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)

View File

@@ -28,7 +28,7 @@ import java.util.List;
/**
* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.4.0-SNAPSHOT")
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
public static final String SERIALIZED_NAME_VALUES = "values";
@SerializedName(SERIALIZED_NAME_VALUES)