-
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 nullable property generation #2076
Conversation
866cfcd
to
6e91f86
Compare
@@ -8,7 +8,7 @@ export interface CloudEvent { | |||
/** Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. */ | |||
source: string; | |||
/** Event data specific to the event type. */ | |||
data?: any; | |||
data?: unknown; |
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 remember we treat unknown as any in the RLC output model ? And in Modular, we don't have the output and input models separated, Is it okay to use unknown 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.
This is a good point, lets park it and have a discussion.
Filed: #2078
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/models/models.ts
Outdated
Show resolved
Hide resolved
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.
Approved and left small comments but I'm not familiar with encoding part.
We have been generating incorrect property types when marked as Nullable in TypeSpec. This PR addresses that and also refactors the involved code for improved readability and maintenance