Is there a way to reference the component securityScheme from a common swagger definitions so I do not need to duplicate it in each of my swagger definitions? Like $ref http://somurl.com/component/securityScheme/oauthSample. If so what is the syntax to add this globally and per path?
You need to "import" the external security scheme definition into the "components/securitySchemes" section of the current file. Then you can define the global and path-level security requirements in the usual way.
Thanks for your response. Swagger is giving me an error saying it can not resolve the reference. I triple checked the path. I even tried adding a reference from the same file as the securitySchemes that I am using and that is not resolving for the securitySchemes.