-
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
Add converter for uint8array map to string and serialization for models #1934
Add converter for uint8array map to string and serialization for models #1934
Conversation
packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/api/operations.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/api/operations.ts
Show resolved
Hide resolved
@@ -25,6 +26,7 @@ export function buildOperationFiles( | |||
needUnexpectedHelper: boolean = true | |||
) { | |||
for (const operationGroup of client.operationGroups) { | |||
utilImports.clear(); |
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 feels odd to have a module-level Set that gets cleared by this method. Does the set need to live outside this method or could it be created when buildOperationFiles is called?
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 put this outside the scope of this buildOperationFiles functions as explained here https://github.com/Azure/autorest.typescript/pull/1934/files#r1282500160
I need to clear this set because the apis per each operationGroup should be generated in an independent file.
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.
oh I see. I'm not wholly against it, but it does create some complexity that could cause unexpected behavior later if someone isn't careful.
Maybe we could later refactor this a bit - I remember when I wrote a prototype TS emitter I had a global bag of context that I passed through every generation method that handled things like tracking deps, etc.
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.
Thanks for the suggestion, will take that into consideration when I try to adopt to TCGC.
fixes #1933 #1554
This PR: