Azure / Azure/azure-openapi-validator
Warnings are reported when using parameters from the common types
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 57
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 2
Description
**Describe the bug**
The following warnings are being reported by the autorest:
```
warning | ParameterNotDefinedInGlobalParameters/R2015/SDKViolation | Parameter "subscriptionid" is referenced but not defined in the global parameters section of Service Definition
warning | ParameterNotDefinedInGlobalParameters/R2015/SDKViolation | Parameter "api-version" is referenced but not defined in the global parameters section of Service Definition
```
These 2 parameters are defined in the swagger as:
```
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
}
```
These are the references to the defined in common-types global parameters, which produce the correct swagger.
It seems that this is a false positive.
**To Reproduce**
Steps to reproduce the behavior:
- Create a swagger json file and reference one of the parameters defined in the common-types (v2) json file.
**Expected behavior**
There should be no warning generated.
**Desktop (please complete the following information):**
- OS: WLS2 Ubuntu 20.04
- Autorest version:
```
AutoRest code generation utility [cli version: 3.6.1; node: v17.9.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Showing All Installed Extensions
Type Extension Name Version Location
extension @autorest/az 1.8.0 /home/mbashtovaya/.autorest/@autorest_az@1.8.0
extension @autorest/clicommon 0.6.2 /home/mbashtovaya/.autorest/@autorest_clicommon@0.6.2
core @autorest/core 3.7.6 /home/mbashtovaya/.autorest/@autorest_core@3.7.6
core @autorest/core 3.8.1 /home/mbashtovaya/.autorest/@autorest_core@3.8.1
core @autorest/core 3.8.3 /home/mbashtovaya/.autorest/@autorest_core@3.8.3
extension @autorest/modelerfour 4.15.421 /home/mbashtovaya/.autorest/@autorest_modelerfour@4.15.421
extension @autorest/python 5.4.0 /home/mbashtovaya/.autorest/@autorest_python@5.4.0
extension @microsoft.azure/classic-openapi-validator 1.1.13 /home/mbashtovaya/.autorest/@microsoft.azure_classic-openapi-validator@1.1.13
extension @microsoft.azure/openapi-validator 1.7.0 /home/mbashtovaya/.autorest/@microsoft.azure_openapi-validator@1.7.0
extension oav 0.4.70 /home/mbashtovaya/.autorest/oav@0.4.70
```
- AutoRest core version: any of the installed (3.7.6, 3.8.1, 3.8.3)
**Additional context**
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.