Skip to content

Commit fc7584a

Browse files
committed
restore hasRequiredParams
1 parent df05f18 commit fc7584a

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
public class CodegenOperation {
2626
public final List<CodegenProperty> responseHeaders = new ArrayList<CodegenProperty>();
27-
public boolean hasAuthMethods, hasConsumes, hasProduces, hasOptionalParams,
27+
public boolean hasAuthMethods, hasConsumes, hasProduces, hasOptionalParams, hasRequiredParams,
2828
returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
2929
isArray, isMultipart, isVoid = false,
3030
hasVersionHeaders = false, hasVersionQueryParams = false,
@@ -372,6 +372,7 @@ public String toString() {
372372
sb.append(", hasConsumes=").append(hasConsumes);
373373
sb.append(", hasProduces=").append(hasProduces);
374374
sb.append(", hasOptionalParams=").append(hasOptionalParams);
375+
sb.append(", hasRequiredParams=").append(hasRequiredParams);
375376
sb.append(", returnTypeIsPrimitive=").append(returnTypeIsPrimitive);
376377
sb.append(", returnSimpleType=").append(returnSimpleType);
377378
sb.append(", subresourceOperation=").append(subresourceOperation);
@@ -453,6 +454,7 @@ public boolean equals(Object o) {
453454
hasConsumes == that.hasConsumes &&
454455
hasProduces == that.hasProduces &&
455456
hasOptionalParams == that.hasOptionalParams &&
457+
hasRequiredParams == that.hasRequiredParams &&
456458
returnTypeIsPrimitive == that.returnTypeIsPrimitive &&
457459
returnSimpleType == that.returnSimpleType &&
458460
subresourceOperation == that.subresourceOperation &&
@@ -528,7 +530,7 @@ public boolean equals(Object o) {
528530
public int hashCode() {
529531

530532
return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasOptionalParams,
531-
returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
533+
hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
532534
isArray, isMultipart, isVoid, isResponseBinary, isResponseFile, isResponseOptional, hasReference,
533535
hasDefaultResponse, hasOnlyDefaultResponse, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
534536
isRestful, isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod,

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4834,6 +4834,8 @@ public CodegenOperation fromOperation(String path,
48344834
// legacy support
48354835
op.nickname = op.operationId;
48364836

4837+
op.hasRequiredParams = op.requiredParams.size() > 0;
4838+
48374839
// check if the operation has only a single parameter
48384840
op.hasSingleParam = op.allParams.size() == 1;
48394841

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,7 @@ public ExtendedCodegenOperation(CodegenOperation o) {
13801380
this.hasConsumes = o.hasConsumes;
13811381
this.hasProduces = o.hasProduces;
13821382
this.hasOptionalParams = o.hasOptionalParams;
1383+
this.hasRequiredParams = o.hasRequiredParams;
13831384
this.returnTypeIsPrimitive = o.returnTypeIsPrimitive;
13841385
this.returnSimpleType = o.returnSimpleType;
13851386
this.subresourceOperation = o.subresourceOperation;

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ public ExtendedCodegenOperation(CodegenOperation o) {
349349
this.hasConsumes = o.hasConsumes;
350350
this.hasProduces = o.hasProduces;
351351
this.hasOptionalParams = o.hasOptionalParams;
352+
this.hasRequiredParams = o.hasRequiredParams;
352353
this.returnTypeIsPrimitive = o.returnTypeIsPrimitive;
353354
this.returnSimpleType = o.returnSimpleType;
354355
this.subresourceOperation = o.subresourceOperation;

0 commit comments

Comments
 (0)