Closed mikeharder closed 8 months ago
@markcowl believes the following rule is incorrect, and should allow LRO with both 202 and 204 responses:
https://github.com/Azure/azure-openapi-validator/blob/main/docs/post-response-codes.md https://github.com/Azure/azure-openapi-validator/blob/main/packages/rulesets/src/spectral/functions/post-response-codes.ts
The rule currently only allows LRO with either 202 | 200 responses, or just 202, but never 202 | 204.
202 | 200
202
202 | 204
The following PR has TypeSpec similar to this:
foo is ArmResourceActionAsync<FooConnector, FooParameters, void>;
https://github.com/Azure/azure-rest-api-specs-pr/pull/16638/files#diff-50b0d71c5f3859fbe9a1ceb4096d1350251ff89dddc1c727406a86d15ef555b4R166
Which generates OpenApi similar to this:
"responses": { "202": { ... }, "204": { "description": "ARM operation completed successfully." }, "default": { ... } }
https://github.com/Azure/azure-rest-api-specs-pr/pull/16638/checks?check_run_id=21130130696
Which causes rule PostResponseCodes to fail.
PostResponseCodes
@AkhilaIlla, @bdefoy, @tejaswiMinnu, @rkmanda: Do you agree with @markcowl that the PostResponseCodes rule is incorrect and should be updated? Or do you think the rule is still correct, and TypeSpec should generate OpenAPI that satisfies the rule?
@mikeharder I think I was mistaken about this. It is supported in TypeSpec, and Mike did verify that SDK clients supported it
@markcowl believes the following rule is incorrect, and should allow LRO with both 202 and 204 responses:
https://github.com/Azure/azure-openapi-validator/blob/main/docs/post-response-codes.md https://github.com/Azure/azure-openapi-validator/blob/main/packages/rulesets/src/spectral/functions/post-response-codes.ts
The rule currently only allows LRO with either
202 | 200
responses, or just202
, but never202 | 204
.The following PR has TypeSpec similar to this:
https://github.com/Azure/azure-rest-api-specs-pr/pull/16638/files#diff-50b0d71c5f3859fbe9a1ceb4096d1350251ff89dddc1c727406a86d15ef555b4R166
Which generates OpenApi similar to this:
https://github.com/Azure/azure-rest-api-specs-pr/pull/16638/checks?check_run_id=21130130696
Which causes rule
PostResponseCodes
to fail.@AkhilaIlla, @bdefoy, @tejaswiMinnu, @rkmanda: Do you agree with @markcowl that the
PostResponseCodes
rule is incorrect and should be updated? Or do you think the rule is still correct, and TypeSpec should generate OpenAPI that satisfies the rule?