Skip to content

Modular generation for typespec-todo#2927

Merged
MaryGao merged 10 commits intoAzure:mainfrom
timovv:modular-unbranded-todo
Dec 12, 2024
Merged

Modular generation for typespec-todo#2927
MaryGao merged 10 commits intoAzure:mainfrom
timovv:modular-unbranded-todo

Conversation

@timovv
Copy link
Copy Markdown
Member

@timovv timovv commented Nov 25, 2024

  • support tcgc type for ModelProperty
  • remove baseUrl in unbranded client
  • remove property if visibility with none.


// @public (undocumented)
export interface TodoItemsUpdateBodyParam {
create: (item: TodoItem, options?: TodoItemsCreateOptionalParams) => Promise<{
Copy link
Copy Markdown
Member Author

@timovv timovv Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Response is an anonymous model but should be a reference to the named model? investigate

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens in quite a few places

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because of there is an @visibilty(create) and this caused we failed to get effective model there, if the visibility create is removed, this should be fixed.

Confirmed with Renhe as below

No need to support visibility create for now. The spec will be updated.

model TodoItem {
/** The item's unique id */
@key id: safeint;
@visibility("read") @key id: safeint;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@visibility not respected

Copy link
Copy Markdown
Member

@MaryGao MaryGao Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read-only should be respected and this is the only case we supported now(codegen code).

Comment thread packages/typespec-ts/src/modular/buildCodeModel.ts
Comment thread packages/typespec-ts/src/modular/helpers/clientHelpers.ts
@MaryGao MaryGao mentioned this pull request Nov 27, 2024
@MaryGao MaryGao marked this pull request as ready for review December 12, 2024 03:15
@MaryGao MaryGao merged commit 8f55b96 into Azure:main Dec 12, 2024
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.

3 participants