-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude GET verb from LroExtension rule validation #616
Exclude GET verb from LroExtension rule validation #616
Conversation
…code and RPC-Post-V1-09(LroExtension) to exclude GET from x-ms-long-running-operation presence validation
docs/get-response-codes.md
Outdated
- RPC-Get-V1-01 | ||
|
||
## Output Message | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use the new template that was decided for the help files. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant find the link where this was documented. Please check with Tejaswi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
July 07, 2022 | ||
|
||
## How to fix the violation | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include good and bad examples #Closed
{ | ||
"packageName": "@microsoft.azure/openapi-validator-rulesets", | ||
"comment": "Update RPC-GET-V1-01(GetOperation200) to allow GET with 202 response code and RPC-Post-V1-09(LroExtension) to exclude GET from x-ms-long-running-operation presence validation", | ||
"type": "patch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"comment": "Update RPC-GET-V1-01(GetOperation200) to allow GET with 202 response code if the GET represents the location header polling url. Update RPC-Post-V1-09(LroExtension) to exclude GET from x-ms-long-running-operation presence validation",
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didnt add
"if the GET represents the location header polling url" cause that isnt being checked in this rule
Make it explicit everywhere that this does not apply to Get including the help file #Closed Refers to: packages/rulesets/generated/spectral/az-arm.js:891 in 290a9a6. [](commit_id = 290a9a6, deletion_comment = False) |
// already have rule to check if operation returns non 2XX, it should mark it as 'x-ms-error-response' explicitly | ||
// https://github.com/Azure/azure-openapi-validator/issues/549 | ||
// GET can return 202 only if it is a polling action & has Location header defined. LroLocationHeader rule already checks if 202 response has Location header | ||
// so here just check for non 200, 202 response codes i.e, '201','203','204' | ||
// RPC Code: RPC-Get-V1-01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not make it an inclusion list for 200, 202 instead of an exclusion list for 201, 203, 204? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That way we get broader coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats a good point!
But we'd not be able to use the core function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#549
This PR contains updates to
RPC-GET-V1-01(GetOperation200): to allow GET with 202 response code and
RPC-Post-V1-09(LroExtension): to exclude GET from x-ms-long-running-operation presence validation
in order to support pooling kinda API's