-
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
support encode for modular #2006
Merged
qiaozha
merged 19 commits into
Azure:main
from
qiaozha:add-encode-test-case-for-modular
Sep 11, 2023
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4540897
add-encode-test-case-for-modular
qiaozha a47b338
try fix modular encoding
qiaozha a34c705
resolve issues in modular bytes encoding and datetime encoding
qiaozha 0389af5
reserve work
qiaozha 4a5e433
reserve work
qiaozha 3b8c6d1
works for duration and bytes
qiaozha c200ad5
works for datetime
qiaozha 135b9c0
try fix ci
qiaozha 60fec35
undo unnecessary changes
qiaozha 2c222a5
fix integration test
qiaozha 6f84151
fix ci
qiaozha 3d8a2da
fix integrationgit
qiaozha 1235e0b
merge main
qiaozha ed91cff
merge main
qiaozha 06ce70c
use auto imports
qiaozha 18a0286
datetime ut
qiaozha 32992d1
fix ci
qiaozha 4448009
add more ut
qiaozha 4508ec8
add header utcDateTime default encoding ut
qiaozha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1082,7 +1082,12 @@ export function _listMetricsSend( | |
metricNamespace: options?.metricNamespace, | ||
timespan: options?.timespan, | ||
}, | ||
body: { filters: options?.filters }, | ||
body: { | ||
filters: (options?.filters ?? []).map((p) => ({ | ||
name: p["name"], | ||
values: p["values"], | ||
})), | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you point to me where is the fix code? |
||
}); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 notice the typespec type here is
utcDateTime
but we generate totoISOString
https://github.com/Azure/autorest.typescript/blob/1235e0ba4762ac1171f5777b50eafb1b7e43a8d0/packages/typespec-test/test/eventgrid_modular/spec/main.tsp#L64-L65C24
Not sure it is possible to add some UTs to cover typespec type to modular type:
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 suspect typespec compiler does not provide any format info to these types, but let me check.
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.
typescript date.toUTCString() is "Fri, 08 Sep 2023 08:50:03 GMT" and date.toISOString() is "2023-09-08T08:42:49.439Z"
therefore use toISOString for utcDateTime makes more sense. and toUTCString for offsetDateTime makes more sense to me.
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.
Yeah, it makes sense to me also. Just checking with Tim here microsoft/typespec#1899 (comment)
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.
It seems both of them share the same default value.
https://microsoft.github.io/typespec/next/standard-library/http/encoding#utcdatetime-and-offsetdatetime
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.
They are not the same