Azure / Azure/azure-sdk-tools

[LintDiff][False positive][data-plane] The PostOperationIdContainsUrlVerb linter rule reports false positive for POST action

Open
#6,098 2 comments 0 reactions 1 assignee Assigned to @konrad-jamrozik View on GitHub
bug Central-EngSys Spec PR Tools
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

The PostOperationIdContainsUrlVerb rule of the azure-openapi-validator reports a false positive for a POST action operation that uses a ":" as the separator between the resource and action name, as recommended by the [Azure Guidelines](https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#actions-url-pattern-for-collection-action).

To reproduce: run this command on an API definition that follows the POST action URL pattern:
```
autorest --v3 --spectral --validation --azure-validator --use=@microsoft.azure/openapi-validator@latest --input-file=
```

For example,
```
f=specification/attestation/data-plane/Microsoft.Attestation/stable/2022-08-01/attestation.json
autorest --v3 --spectral --validation --azure-validator --use=@microsoft.azure/openapi-validator@latest --input-file=$f
```

generates (among many messages):
```
- file:///Users/mikekistler/Projects/Azure/azure-rest-api-specs/specification/attestation/data-plane/Microsoft.Attestation/stable/2022-08-01/attestation.json:466:7
warning | PostOperationIdContainsUrlVerb | OperationId should contain the verb: '{attestationtype}:reset' in:'Policy_Reset'. Consider updating the operationId
- file:///Users/mikekistler/Projects/Azure/azure-rest-api-specs/specification/attestation/data-plane/Microsoft.Attestation/stable/2022-08-01/attestation.json:130:9
warning | PostOperationIdContainsUrlVerb | OperationId should contain the verb: 'certificates:add' in:'PolicyCertificates_Add'. Consider updating the operationId
- file:///Users/mikekistler/Projects/Azure/azure-rest-api-specs/specification/attestation/data-plane/Microsoft.Attestation/stable/2022-08-01/attestation.json:212:9
warning | PostOperationIdContainsUrlVerb | OperationId should contain the verb: 'certificates:remove' in:'PolicyCertificates_Remove'. Consider updating the operationId
- file:///Users/mikekistler/Projects/Azure/azure-rest-api-specs/specification/attestation/data-plane/Microsoft.Attestation/stable/2022-08-01/attestation.json:254:9
```

These are all false positives.

Note that the ":" may appear either after a path parameter or after a static path segment.

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.