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

Define a property of model with default value returns error in autorest & OAS3 emitter #4238

Closed
4 tasks done
lirenhe opened this issue Aug 22, 2024 · 1 comment
Closed
4 tasks done
Assignees
Labels
compiler:core Issues for @typespec/compiler feature New feature or request triaged:core

Comments

@lirenhe
Copy link
Member

lirenhe commented Aug 22, 2024

Describe the bug

model Test {

user: {
name: string;
} = #{ name: "System" };
}
returns error of 'Invalid type 'ObjectValue' for a default value' in cadl playground.

Reproduction

https://azure.github.io/typespec-azure/playground?c=Cgptb2RlbCBUZXN0IHsKCiAgdXNlcjogewogICAgbmFtZTogc3RyaW5nOwogIH0gPSAje8cXIlN5c3RlbSIgfTsKfQo%3D&e=%40azure-tools%2Ftypespec-autorest&options=%7B%22linterRuleSet%22%3A%7B%22extends%22%3A%5B%22%40azure-tools%2Ftypespec-azure-rulesets%2Fdata-plane%22%5D%7D%7D

Checklist

@lirenhe lirenhe added the bug Something isn't working label Aug 22, 2024
@markcowl markcowl added this to the [2024] September milestone Aug 26, 2024
@markcowl markcowl added triaged:core compiler:core Issues for @typespec/compiler and removed needs-area labels Aug 26, 2024
@timotheeguerin
Copy link
Member

Same as #4193 this is more of a feature request where we have never supported non primitive default values

@allenjzhang allenjzhang changed the title [Bug]: Define a property of model with default value returns error in autorest & OAS3 emitter Define a property of model with default value returns error in autorest & OAS3 emitter Sep 12, 2024
@AlitzelMendez AlitzelMendez self-assigned this Sep 12, 2024
@AlitzelMendez AlitzelMendez added feature New feature or request and removed bug Something isn't working labels Sep 16, 2024
github-merge-queue bot pushed a commit to Azure/typespec-azure that referenced this issue Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:core Issues for @typespec/compiler feature New feature or request triaged:core
Projects
None yet
Development

No branches or pull requests

4 participants