Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI 3.0 securitySchemes ApiKey type not supported? #4790

Open
shemsargent-ch opened this issue Oct 30, 2023 · 0 comments
Open

OpenAPI 3.0 securitySchemes ApiKey type not supported? #4790

shemsargent-ch opened this issue Oct 30, 2023 · 0 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@shemsargent-ch
Copy link

Context: Rapid7 InsightVM Cloud Integrations API
Swagger file directly downloadable from that page.

Spec: OpenAPI Components Object Sample

The spec seems to contain a similar structure to what the error below seems refer to. Any idea if the swagger file is the problem or if the autorest.powershell is not handling the ApiKey securityScheme type correctly? Or something else less obvious?

> autorest --powershell --input-file:swagger.json --output-folder:PowerShell --verbose
AutoRest code generation utility [cli version: 3.6.3; node: v20.9.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest        
info    |    Loading AutoRest core      'C:\Users\[username]\.autorest\@autorestcore@3.9.7\nodemodules\@autorest\core\dist' (3.9.7)
verbose | [0.97 s] No configuration found at 'file:///C:/Users/[username]/ITOps/Security/ApiBuilder/Rapid7InsightVM_Cloud_IntegrationsAPI/'.
verbose | [0.97 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/default-configuration.md'
verbose | [1.00 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/inspect.md'
verbose | [1.00 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/directives.md'
verbose | [1.01 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/pipeline.md'      
verbose | [1.02 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/loader-openapi.md'
verbose | [1.03 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/miscellaneous.md'    
verbose | [1.04 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-powershell.md'
verbose | [1.05 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-azureresourceschema.md'
verbose | [1.06 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-csharp.md'
verbose | [1.08 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-go.md'
verbose | [1.09 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-java.md'  
verbose | [1.10 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-nodejs.md'
verbose | [1.12 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-php.md'
verbose | [1.13 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-python.md'
verbose | [1.14 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-ruby.md'
verbose | [1.16 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-typescript.md'
verbose | [1.18 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-validators.md'
verbose | [1.19 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-az.md'
verbose | [1.21 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-terraform.md'
verbose | [1.22 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-azure-functions.md'
verbose | [1.24 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/plugin-openapi-to-cadl.md'
verbose | [1.25 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/graphs.md'
verbose | [1.27 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestcore@3.9.7/nodemodules/@autorest/core/dist/resources/help-configuration.md'
info    |
The default version of @autorest/powershell has been bumped from 2.1+ to 3.0+.
 > If you still want to use 2.1+ version, please specify it with --use:@autorest/powershell@2.1.{x}, e.g 2.1.401.

info    |    Loading AutoRest extension '@autorest/powershell' (~3.0.0->3.0.512)
verbose | [1.33 s]    Including extension configuration file 'file:///C:/Users/[username]/.autorest/@autorestpowershell@3.0.512/nodemodules/@autorest/powershell/readme.md'
verbose | [1.33 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestpowershell@3.0.512/nodemodules/@autorest/powershell/readme.md'
verbose | [1.35 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestpowershell@3.0.512/nodemodules/@autorest/powershell/autorest-configuration.md'
info    |    Loading AutoRest extension '@autorest/modelerfour' (4.15.414->4.15.414)
verbose | [1.47 s]    Including extension configuration file 'file:///C:/Users/[username]/.autorest/@autorestmodelerfour@4.15.414/nodemodules/@autorest/modelerfour/readme.md'
verbose | [1.47 s]    Including configuration file 'file:///C:/Users/[username]/.autorest/@autorestmodelerfour@4.15.414/nodemodules/@autorest/modelerfour/readme.md'
verbose | [5.39 s] Reading OpenAPI 3.0 file file:///C:/Users/[username]/ITOps/Security/ApiBuilder/Rapid7InsightVM_Cloud_IntegrationsAPI/swagger.json
error   | schema_violation | Schema violation: must NOT have additional properties (components > securitySchemes > api-key)
  additionalProperty: bearerFormat, name, in
    - file:///C:/Users/[username]/ITOps/Security/ApiBuilder/Rapid7_InsightVM_Cloud_Integrations_API/swagger.json:5567:7
error   | schema_violation | Schema violation: must be equal to one of the allowed values (components > securitySchemes > api-key > type)
  allowedValues: http, oauth2, openIdConnect
    - file:///C:/Users/[username]/ITOps/Security/ApiBuilder/Rapid7_InsightVM_Cloud_Integrations_API/swagger.json:5568:9
fatal   | Plugin 'schema-validator-openapi' completed with some error.
error   |   Error: Plugin 'schema-validator-openapi' completed with some error.
@dolauli dolauli transferred this issue from Azure/autorest.powershell Nov 2, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

1 participant