Skip to content
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

Merged
merged 8 commits into from
Oct 23, 2023
Merged

Conversation

joheredi
Copy link
Member

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

@@ -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;
Copy link
Member

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 ?

Copy link
Member Author

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-ts/package.json Outdated Show resolved Hide resolved
packages/typespec-ts/src/modular/emitModels.ts Outdated Show resolved Hide resolved
Copy link
Member

@MaryGao MaryGao left a 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.

@joheredi joheredi merged commit aa3f117 into Azure:main Oct 23, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants