mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
Add operationIdOriginal to store the original operationId (#7522)
* add operationIdOriginal to store the original operationId * store the original operation Id in DefaultCodegen
This commit is contained in:
parent
d01a60cb14
commit
13e3db59e3
@ -38,6 +38,7 @@ public class CodegenOperation {
|
||||
public ExternalDocs externalDocs;
|
||||
public Map<String, Object> vendorExtensions;
|
||||
public String nickname; // legacy support
|
||||
public String operationIdOriginal; // for plug-in
|
||||
public String operationIdLowerCase; // for markdown documentation
|
||||
public String operationIdCamelCase; // for class names
|
||||
public String operationIdSnakeCase;
|
||||
@ -294,6 +295,8 @@ public class CodegenOperation {
|
||||
return false;
|
||||
if ( prioritizedContentTypes != null ? !prioritizedContentTypes.equals(that.prioritizedContentTypes) : that.prioritizedContentTypes != null )
|
||||
return false;
|
||||
if ( operationIdOriginal != null ? !operationIdOriginal.equals(that.operationIdOriginal) : that.operationIdOriginal != null )
|
||||
return false;
|
||||
if ( operationIdLowerCase != null ? !operationIdLowerCase.equals(that.operationIdLowerCase) : that.operationIdLowerCase != null )
|
||||
return false;
|
||||
return operationIdCamelCase != null ? operationIdCamelCase.equals(that.operationIdCamelCase) : that.operationIdCamelCase == null;
|
||||
@ -349,6 +352,7 @@ public class CodegenOperation {
|
||||
result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
|
||||
result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
|
||||
result = 31 * result + (prioritizedContentTypes != null ? prioritizedContentTypes.hashCode() : 0);
|
||||
result = 31 * result + (operationIdOriginal != null ? operationIdOriginal.hashCode() : 0);
|
||||
result = 31 * result + (operationIdLowerCase != null ? operationIdLowerCase.hashCode() : 0);
|
||||
result = 31 * result + (operationIdCamelCase != null ? operationIdCamelCase.hashCode() : 0);
|
||||
return result;
|
||||
|
@ -2023,6 +2023,9 @@ public class DefaultCodegen {
|
||||
Set<String> imports = new HashSet<String>();
|
||||
op.vendorExtensions = operation.getVendorExtensions();
|
||||
|
||||
// store the original operationId for plug-in
|
||||
op.operationIdOriginal = operation.getOperationId();
|
||||
|
||||
String operationId = getOrGenerateOperationId(operation, path, httpMethod);
|
||||
// remove prefix in operationId
|
||||
if (removeOperationIdPrefix) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user