-
Notifications
You must be signed in to change notification settings - Fork 245
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
Scalar cannot extend unknown #1645
Comments
Can you say more about why? |
One use case is that I can attach doc to the "unknown" (any) values. For example:
|
I see. Unknown is not a scalar so I wouldn't expect this to work. I'm not sure how to declare a new type that is functionally equivalent to unknown but decoratable, though, so this may just not be supported at a deeper level. We have talked about (and resisted) decoration of aliases which would help here. |
I think the error you get here is not particularly helpful though, it should be more like what you get when you extend unknown with a model |
Okay ... I see. I don't need to extend "unknown" in the scenario above. I can just write:
|
You can def do that, the issue is that |
fix error message to indicate how to create a new scalar |
est: 3 |
@bterlson ParamValue does behave like openapi3 playground example: link autorest playground example: link |
I was more talking about the TypeSpec side semantics around subtyping etc. But I would also argue the current emit behavior is unexpected since we would allow e.g. an object for a type declared as scalar. |
Cadl does not allow a scalar to extend unknown.
This should be supported.
The text was updated successfully, but these errors were encountered: