-
Notifications
You must be signed in to change notification settings - Fork 76
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-models-subpath-in-modular-generation #1915
add-models-subpath-in-modular-generation #1915
Conversation
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.
@xirzec @mpodwysocki @witemple-msft You may mainly focus on the changes in openai_modular smoke test which are in
packages/typespec-test/test/openai_modular/generated/typespec-ts
folder of this repo.
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/api/index.ts
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/api/operations.ts
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/index.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/models/index.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/OpenAIClient.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/package-files/package.json
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/OpenAIClient.ts
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.
This looks correct to me. @mpodwysocki does this follow the same conventions as notification hub?
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/models/options.ts
Show resolved
Hide resolved
packages/typespec-test/test/widget_dpg/generated/typespec-ts/src/models/options.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/widget_dpg/generated/typespec-ts/src/api/operations.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.
Looks good to me! The generated examples are what I expected and this seems to be well aligned with what we have done for NotificationHubs.
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/api/operations.ts
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/api/operations.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/openai_modular/generated/typespec-ts/src/OpenAIClient.ts
Outdated
Show resolved
Hide resolved
packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/api/operations.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.
Overall LGTM, only have one small concern for the inconsistancy import between the api layer and classical layer for models.
@bterlson I am going to merge this PR now, feel free to let me know if you found anything, we can always change back 😊 |
This PR is meant to reflect the suggested changes on adding a models subpath export in the modular generation.
In the previous implementation, we generated
src/api/models.ts
and export all models to both the api layerindex.ts
, and the classical client layer.This PR:
src/models/models.ts
, and all the operation options intosrc/models/options.ts
.index.ts
fixes #1913