Azure / Azure/oav

[validate-examples] Example validation fails to validate resource IDs for location-based resources

Open Beginner friendly
#1,074 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
104
Forks
62
Avg merge
2d 12h
Merged PRs (30d)
5

Description

Location-based resources (e.g. defined via the [`@locationResource` decorator](https://azure.github.io/typespec-azure/docs/howtos/arm/resource-type/#location-based-resource) in TypeSpec) have a resource ID following the format `/subscriptions/{subscriptionId}/locations/{location}/providers/Microsoft.Contoso/employees`.

The current `arm-id` format does not allow such resource IDs: https://github.com/Azure/oav/blob/develop/lib/swaggerValidator/ajv.ts#L137-L146, and will cause examples for these resources to fail validation on their `id` property with `INVALID_FORMAT`.

Contributor guide

Open the contributing guide

Research direction

Start in lib/swaggerValidator/ajv.ts at the arm-id format definition around lines 137-146 and compare its accepted structure with the location-based resource ID shown in the issue. Reproduce validation for a location-based resource example, then confirm that its id passes without INVALID_FORMAT while existing arm-id validation still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi, typescript
Domain
api, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.