Azure / Azure/azure-openapi-validator

AutoRest linter ignore rules do not work consistently

Open
#70 2 comments 0 reactions 0 assignees View on GitHub
investigate planned
Dominant language
TypeScript
Stars
53
Forks
57
Avg merge
1d 23h
Merged PRs (30d)
2

Description

I tried to add some linter ignore rules to the `readme.md` file in [this pr](https://github.com/Azure/azure-rest-api-specs/pull/1436). But for some reason, some of the ignore rules I tried to add didn't work (so I removed them).

If you look at the output of the build [here](https://travis-ci.org/Azure/azure-rest-api-specs/jobs/254966222) you'll see things like this:
```
{
"type": "Error",
"code": "DefinitionsPropertiesNamesCamelCase",
"message": "Property named: 'userCPUTime', for definition: 'TaskStatistics' must follow camelCase style. Example: 'userCpUtime'.",
"id": "R3016",
"validationCategory": "RPCViolation",
"providerNamespace": null,
"resourceType": null,
"sources": [
"file:///home/travis/build/Azure/azure-rest-api-specs/specification/batch/data-plane/Microsoft.Batch/2017-06-01.5.1/BatchService.json:13125:8 ($.userCPUTime.properties.TaskStatistics.definitions)"
]
}
```

Note that the JSONPath expression is wrong (as far as I can tell, it's backwards): `$.userCPUTime.properties.TaskStatistics.definitions`

If I try to ignore these properties with either the correct path `$.definitions.TaskStatistics.properties.userCPUTime` or the incorrect one `$.userCPUTime.properties.TaskStatistics.definitions` it doesn't correctly ignore the error.

Sometimes, when I ignore one error (successfully), the next errors are then displayed with a reverse of the JSONPath they had before. So for example, if I am able to ignore error 1 (at location `$.definitions.TaskStatistics.properties.userCPUTime` and then re-run the linter, the remaining error locations all swap (so if they were `$.definitions....` in run 1, they swap to being `$...definitions` in run 2.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.