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

Dpg - Generate anonymous models inline #2067

Closed
joheredi opened this issue Oct 17, 2023 · 0 comments · Fixed by #2072
Closed

Dpg - Generate anonymous models inline #2067

joheredi opened this issue Oct 17, 2023 · 0 comments · Fixed by #2072
Assignees

Comments

@joheredi
Copy link
Member

joheredi commented Oct 17, 2023

TypeSpec allows defining anonymous models:

model Foo {
   bar: {
       baz: string;
    }
}

TypeScript allows generating this so we should generate similar to the TypeSpec definition

interface Foo {
   bar: {
       baz: string;
    }
}

This will solve some issues identified:

  • Problem with TypeScript Emitter not generating anonymous or inline objects
  • Issue with inline models not serializing. Workaround: Handwrite model.
  • output model for Error (=> ErrorModel) is not being generated. Workaround: Handwrite model which also solves the isUnexpected issue.
  • Issue with isUnexpected not narrowing down types in functions like _createFineTuningJobDeserialize.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants