Open mikeharder opened 8 months ago
Here's another example. Perhaps consider allowing the word current
as singleton as well: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/providers/Microsoft.HybridCompute/networkConfigurations/current
The regex used by
EvenSegmentedPathForPutOperation
requires the last path segment to be wrapped in curly braces:https://github.com/Azure/azure-openapi-validator/blob/2873e674ce169c7c459a1a8028d75e058ff0f873/packages/rulesets/src/spectral/az-arm.ts#L556
This fails to match the OpenAPI generated by TypeSpec
@singletons
:But it does match the OpenAPI generated by TypeSpec when not using
@singleton
:Should
EvenSegmentedPathForPutOperation
be adjusted to make optional the curly braces around the last path segment? Or even allow only the stringdefault
for TypeSpec singletons?Rule
XmsPageableForListCalls
has a similar bug but in the opposite direction. It assumes if a path does not end with}
, it must specifyx-ms-pageable
, which I believe should not apply to thedefault
path generated from TypeSpec@singleton
.https://github.com/Azure/azure-openapi-validator/blob/2873e674ce169c7c459a1a8028d75e058ff0f873/packages/rulesets/src/spectral/az-arm.ts#L385