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

[MPG][Diff] default value in Typespec, Swagger and SDK #35759

Open
msyyc opened this issue May 24, 2024 · 0 comments
Open

[MPG][Diff] default value in Typespec, Swagger and SDK #35759

msyyc opened this issue May 24, 2024 · 0 comments
Assignees
Labels
Mgmt This issue is related to a management-plane library.

Comments

@msyyc
Copy link
Member

msyyc commented May 24, 2024

TypeSpec could use = to define default value for optional properties of a model or parameter, it equals to default of swagger like:

image

default value of both Typespec and swagger means server will use it instead of client side:
image

  • Python SDK from typespec:
    image

  • Python SDK from swagger:
    image

We can see there is difference between SDK generated from swagger and Typespec. I think the root cause is that m4 provides defaultValue while TCGC not:

image

@msyyc msyyc added the Mgmt This issue is related to a management-plane library. label May 24, 2024
@msyyc msyyc self-assigned this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

No branches or pull requests

1 participant