[BUG] when feign useing,must be define securitySchemes => oauth ,
Created by: xiaowenquan
Description
wehn I useing feign generate cli code , must define oauth in openapi.yml . otherwise , can not package code;
openapi-generator version
openapi-generator-cli-5.1.0
OpenAPI declaration file content or url
paths:
/xxx/{systemId}/xxxx:
get:
summary: xxx
tags:
- xxxx
operationId: xxxx
parameters:
- name: systemId
in: path
required: true
explode: false
schema:
type: integer
format: int32
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseCode'
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth: # arbitrary name for the security scheme
type: http
scheme: bearer
bearerFormat: JWT # optional, arbitrary value for documentation purposes
schemas:
ResponseCode:
type: string
enum:
- M0000
x-enum-varnames:
- SUCCESS
Generation Details
java -jar openapi-generator-cli-5.1.0.jar generate -i xxx-center.yaml -g java --api-package com.xxx.client.api --model-package com.xxx.client.model --invoker-package com.xxx.client.invoker --group-id com.xxx --artifact-id xxx-client --artifact-version 0.0.1-SNAPSHOT --library feign -o xxx-api-client
Steps to reproduce
Related issues/PRs
mvn clean package install -f xxx-api-client/pom.xml
Suggest a fix
when undefine oauth , exclude buildOauthRequestInterceptor method , in path openapi-generator/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache