-
Notifications
You must be signed in to change notification settings - Fork 75
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
Fix issues in FACE AI spec #2484
Conversation
Update faceai .tsp files
"GET /lro/put/200/succeeded": ["200", "204"], | ||
"PATCH /lro/patch/200/succeeded/ignoreheaders": ["200"], | ||
"PUT /lro/put/200/succeeded": ["200", "204"], |
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.
just position change.
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.
when are you going to fix this issue #2264 ?
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.
this is not relevant to the #2264 issue, the position changed because we adjust the isUnexcepected implementation a little bit.
"GET /lro/put/200/succeeded": ["200", "204"], | ||
"PATCH /lro/patch/200/succeeded/ignoreheaders": ["200"], | ||
"PUT /lro/put/200/succeeded": ["200", "204"], |
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.
when are you going to fix this issue #2264 ?
response: | ||
| PublishCloudEvent200Response | ||
| PublishCloudEvents200Response | ||
| PublishCloudEventDefaultResponse, | ||
response: PublishCloudEvent200Response | PublishCloudEventDefaultResponse, |
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.
what is causing the changes here ?
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.
bug here, see comments #2484 (comment)
@@ -59,7 +65,7 @@ export interface ProcessInt { | |||
|
|||
export interface Routes { | |||
/** Resource for '/sharedroute/query' has methods for the following verbs: post */ | |||
(path: "/sharedroute/query"): ListByResourceGroup; | |||
(path: "/sharedroute/query"): ListBySubscription; |
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.
what is causing the change here ? operation order change?
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.
no the bug is introduced by overload. previously we combined the overloading responses together and this would introduce issues for non-matching logical response.
@@ -0,0 +1,114 @@ | |||
// Copyright (c) Microsoft Corporation. |
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 this is not generated before?
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 update the tsp, previously there is only one status code defined so no isUnexpected helper would generate.
|
||
/** There is no content to send for this request, but the headers may be useful. */ | ||
export interface ListBySubscription204Response extends HttpResponse { | ||
status: "204"; |
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 is the response code 204 for list operation? and is it really expected to have no body in list response ?
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.
okay i just created an test case for different status code would return different body shape.
I change the code to 202 now.
@@ -68,4 +71,129 @@ describe("Client definition generation", () => { | |||
` | |||
); | |||
}); | |||
|
|||
describe("union & enum parameter in path", () => { |
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.
can you add test cases for union and enum being used in query and header ?
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.
Added the cases for query. And there exist cases in header: https://github.com/Azure/autorest.typescript/blob/main/packages/typespec-ts/test/unit/modelsGenerator.spec.ts#L3324-L3767
@@ -135,7 +136,8 @@ export interface PagingDetails { | |||
} | |||
|
|||
export type Methods = { | |||
[key: string]: [OperationMethod]; | |||
// could be more than one method if overloading | |||
[key: string]: [OperationMethod, ...OperationMethod[]]; |
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.
Is it trying to suggest there's at least one OperationMethod ? is it necessary?
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.
change to OperationMethod[]
packages/typespec-test/test/faceai/generated/typespec-ts/src/isUnexpected.ts
Show resolved
Hide resolved
Update faceai .tsp
…orest.typescript into fix-path-union-issue
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.
LGTM
fixes #2474