source is empty for IgnoredPropertyNextToRef warnings
- Dominant language
- TypeSpec
- Stars
- 4.8k
- Forks
- 736
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 1
Description
I'm working on this https://github.com/Azure/azure-rest-api-specs-pr/pull/11977 and trying to fix validation errors. When I add `--verbose`, the `IgnoredPropertyNextToRef` returns `"source":[]` while
```
PS C:\Users\cataggar\ms\azure-rest-api-specs-pr> autorest --version=3.9.6 --spectral --azure-validator --semantic-validator=false --model-validator=false --message-format=json --openapi-type=arm --use=@microsoft.azure/openapi-validator@2.1.2 --tag=package-2023-09-01 --verbose specification/vmware/resource-manager/readme.md
```
``` json
{"level":"warning","code":"IgnoredPropertyNextToRef","message":"Semantic violation: Sibling values alongside $ref will be ignored. See https://github.com/Azure/autorest/blob/main/docs/openapi/howto/$ref-siblings.md for allowed values (components > schemas > Resource > properties > systemData)\n **keys**: [ \u001b[32m'type'\u001b[39m ]","source":[],"details":{"level":"warn","code":"IgnoredPropertyNextToRef","message":"Sibling values alongside $ref will be ignored. See https://github.com/Azure/autorest/blob/main/docs/openapi/howto/$ref-siblings.md for allowed values","path":["components","schemas","Resource","properties","systemData"],"params":{"keys":["type"]}}}
```
Other errors provide the exact source location of the error:
``` json
{"pluginName":"classic-openapi-validator","extensionName":"@microsoft.azure/classic-openapi-validator","level":"warning","message":"The tracked resource, 'PrivateCloud', must have a list by subscriptions operation.","code":"TrackedResourceListBySubscription/R3028/ARMViolation","details":{"type":"Warning","code":"TrackedResourceListBySubscription","message":"The tracked resource, 'PrivateCloud', must have a list by subscriptions operation.","id":"R3028","validationCategory":"ARMViolation","providerNamespace":null,"resourceType":null},"source":[{"document":"file:///C:/Users/cataggar/ms/azure-rest-api-specs-pr/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/vmware.json","position":{"line":6063,"column":5}}]}
```
Please add the source location for IgnoredPropertyNextToRef warnings.
Contributor guide
Research direction
Start by rerunning the provided AutoRest command against specification/vmware/resource-manager/readme.md and compare the IgnoredPropertyNextToRef JSON with the source-bearing warning. Use specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/vmware.json and the components.schemas.Resource.properties.systemData path to verify the reported location; done means the warning no longer has source:[] and includes its document and position.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100