x-ms-odata to be interpreted by the validation tool
- Dominant language
- TypeScript
- Stars
- 104
- Forks
- 62
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 5
Description
When running validate.js for arm-authorization spec and recordings from .net tests, I got the following warnings:
[ { code: 'UNUSED_DEFINITION',
message: 'Definition is defined but is not used: #/definitions/RoleAssignmentFilter',
path: [ 'definitions', 'RoleAssignmentFilter' ] },
{ code: 'UNUSED_DEFINITION',
message: 'Definition is defined but is not used: #/definitions/RoleDefinitionFilter',
path: [ 'definitions', 'RoleDefinitionFilter' ] } ],
code: 'INTERNAL_ERROR' } ] }
The definition is used in x-ms-odata extension (see below), it looks like a proper usage of it, thoughts? Because it’s our extension I assume is not being picked up by swagger tools, so we’d have to figure out how to account for it.
"/{scope}/providers/Microsoft.Authorization/roleDefinitions": {
"get": {
"tags": [
"RoleDefinitions"
],
"operationId": "RoleDefinitions_List",
"description": "Get all role definitions that are applicable at scope and above.",
"parameters": [
{
"name": "scope",
"in": "path",
"required": true,
"type": "string",
"description": "The scope of the role definition.",
"x-ms-skip-url-encoding": true
},
{
"name": "$filter",
"in": "query",
"required": false,
"type": "string",
"description": "The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well."
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK - Returns an array of role definitions.",
"schema": {
"$ref": "#/definitions/RoleDefinitionListResult"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-odata": "#/definitions/RoleDefinitionFilter",
Contributor guide
Research direction
Start by running validate.js against the arm-authorization spec and .NET test recordings to reproduce the UNUSED_DEFINITION warnings. Trace how the validator detects definition usage and how it handles the x-ms-odata extension shown in the issue; done means RoleAssignmentFilter and RoleDefinitionFilter are recognized as used without regressing validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100