Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
handling security with io.swagger.core.v3 in version 2.1.1
fixed comment
  • Loading branch information
alexsuperdev committed Mar 8, 2020
1 parent f3e6135 commit 4592a00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public void setUnhandledException(boolean unhandledException) {
@Override
public CodegenModel fromModel(String name, Schema model) {
CodegenModel codegenModel = super.fromModel(name, model);
// Remove io.swagger.annotations.ApiModel import
// Remove io.swagger.annotations.ApiModel and io.swagger.annotations.ApiModelProperty imports
codegenModel.imports.remove("ApiModel");
codegenModel.imports.remove("ApiModelProperty");
return codegenModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.enums.*;
import io.swagger.v3.oas.annotations.media.*;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
{{#jdk8-no-delegate}}
{{#virtualService}}
Expand Down Expand Up @@ -112,11 +113,18 @@ public interface {{classname}} {
{{#virtualService}}
@ApiVirtual
{{/virtualService}}
@Operation(summary = "{{{summary}}}", description = "{{{notes}}}",
@Operation(summary = "{{{summary}}}", operationId = "{{{operationId}}}", description = "{{{notes}}}",
tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} },
{{#hasAuthMethods}}
{{#authMethods}}security = @SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes = {
{{#scopes}} "{{scope}}" {{#hasMore}},
{{/hasMore}} {{/scopes}}
}{{/isOAuth}}){{#hasMore}},
{{/hasMore}}{{/authMethods}},
{{/hasAuthMethods}}
responses = { {{#responses}}
@ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}" {{#baseType}}, content = { @Content( {{#containerType}}schema = @Schema(implementation = {{{baseType}}}.class){{/containerType}}{{^containerType}} array = @ArraySchema(schema = @Schema(implementation = {{{baseType}}}.class)) {{/containerType}} )} {{/baseType}} ){{#hasMore}} ,{{/hasMore}} {{/responses}} })
{{#implicitHeaders}}}
{{#implicitHeaders}}
@ApiImplicitParams({
{{#headerParams}}
{{>implicitHeader}}
Expand Down

0 comments on commit 4592a00

Please sign in to comment.