Skip to content

[AvoidAdditionalProperties] Errors should only be reported once per source code location (ignore $refs) #697

@mikeharder

Description

@mikeharder

To reduce noise, errors should only be reported once per source code location. If another location consumes the code via a $ref, the error should not be duplicated to the consuming location.

An example is this PR, where there are only 3 instances of vmTags.additionalProperties in the source code, but about 9 AvoidAdditionalProperties errors are reported, since the instances are consumed other places via $ref.

https://github.com/Azure/azure-rest-api-specs/pull/29101/checks?check_run_id=25631949240

image

Local repro:

gh pr checkout 29101
git checkout 3a64798
$ npx autorest --v3 --spectral --azure-validator --semantic-validator=false --model-validator=false --openapi-type=arm --openapi-subtype=arm --use=@microsoft.azure/openapi-validator@2.2.2 --tag=package-preview-2024-04 specification/desktopvirtualization/resource-manager/readme.md

Related: #286

CC: @markcowl

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

🎊 Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions