OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.64k stars 6.53k forks source link

Generated swagger url definition yaml throws Security requirements must match a security definition #9390

Open sharathkolibyle opened 3 years ago

sharathkolibyle commented 3 years ago
Description

I am using api.yaml file which is being used to generate. the generated swagger url json doesn't have securityschemes. I tried pasting the json content into swagger editor and see Security requirements must match a security definition

openapi-generator version
OpenAPI declaration file content or url

This is defined yaml under resource folder

openapi: 3.0.2 info: title: APIs description: 'Policy APIs for manage Policy Sets, authorization policies, authentication policies, and policy elements.' version: 1.0.0 license: name: Apache 2.0 url: 'https://www.apache.org/licenses/LICENSE-2.0.html' contact: email: sbc@gmail.com servers:


This is generated json converted yaml

openapi: 3.0.3 info: title: Test YAML version: 1.0.0 servers:

I see securitySchemes component is missed in the generated definition json. Please let me know if i am doing something wrong

Suggest a fix/enhancement
sharathkolibyle commented 3 years ago

similar issue - https://github.com/OpenAPITools/openapi-generator/issues/6427

sharathkolibyle commented 3 years ago

openapi doesn't generate securitySchemes part defined in yaml file.

cyril-telr commented 5 months ago

no any answer ? i have same issue n 2024