Skip to content

Commit

Permalink
OpenAPITools#14141 Add externalDocs to @operation to the JavaSpring g…
Browse files Browse the repository at this point in the history
…enerator: remove hasExternalDocs
  • Loading branch information
arey committed Dec 12, 2022
1 parent a06d0a8 commit 819e33b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class CodegenOperation {
public final List<CodegenProperty> responseHeaders = new ArrayList<CodegenProperty>();
public boolean hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams, hasRequiredParams, hasExternalDocs,
public boolean hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams, hasRequiredParams,
returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
isArray, isMultipart,
isResponseBinary = false, isResponseFile = false, isResponseOptional = false, hasReference = false, defaultReturnType = false,
Expand Down Expand Up @@ -316,7 +316,6 @@ public String toString() {
sb.append(", hasParams=").append(hasParams);
sb.append(", hasOptionalParams=").append(hasOptionalParams);
sb.append(", hasRequiredParams=").append(hasRequiredParams);
sb.append(", hasExternalDocs=").append(hasExternalDocs);
sb.append(", returnTypeIsPrimitive=").append(returnTypeIsPrimitive);
sb.append(", returnSimpleType=").append(returnSimpleType);
sb.append(", subresourceOperation=").append(subresourceOperation);
Expand Down Expand Up @@ -394,7 +393,6 @@ public boolean equals(Object o) {
hasParams == that.hasParams &&
hasOptionalParams == that.hasOptionalParams &&
hasRequiredParams == that.hasRequiredParams &&
hasExternalDocs == that.hasExternalDocs &&
returnTypeIsPrimitive == that.returnTypeIsPrimitive &&
returnSimpleType == that.returnSimpleType &&
subresourceOperation == that.subresourceOperation &&
Expand Down Expand Up @@ -464,7 +462,7 @@ public boolean equals(Object o) {
public int hashCode() {

return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams,
hasRequiredParams, hasExternalDocs, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
isArray, isMultipart, isResponseBinary, isResponseFile, isResponseOptional, hasReference,
hasDefaultResponse, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
isRestful, isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4478,7 +4478,6 @@ else if (one.required)
op.requiredParams = requiredParams;
op.optionalParams = optionalParams;
op.externalDocs = operation.getExternalDocs();
op.hasExternalDocs = op.externalDocs != null;
// legacy support
op.nickname = op.operationId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
{{#hasExternalDocs}}
{{#externalDocs}}
import io.swagger.v3.oas.annotations.ExternalDocumentation;
{{/hasExternalDocs}}
{{/externalDocs}}
{{/swagger2AnnotationLibrary}}
{{#swagger1AnnotationLibrary}}
import io.swagger.annotations.*;
Expand Down Expand Up @@ -173,8 +173,8 @@ public interface {{classname}} {
{{#authMethods}}
@SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes={ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} }{{/isOAuth}}){{^-last}},{{/-last}}
{{/authMethods}}
}{{/hasAuthMethods}}{{#hasExternalDocs}},
externalDocs = @ExternalDocumentation(description = "{{externalDocs.description}}", url = "{{externalDocs.url}}"){{/hasExternalDocs}}
}{{/hasAuthMethods}}{{#externalDocs}},
externalDocs = @ExternalDocumentation(description = "{{externalDocs.description}}", url = "{{externalDocs.url}}"){{/externalDocs}}
)
{{/swagger2AnnotationLibrary}}
{{#swagger1AnnotationLibrary}}
Expand Down

0 comments on commit 819e33b

Please sign in to comment.