microsoft / microsoft/typespec
Decorators that provide value validation don't do it when defined on properties
Open
bug
compiler:core
triaged:core
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
```tsp
model Foo {
@maxLength(3)
foo: string;
}
@maxLength(3)
scalar Bar extends string;
const bar: Bar = "abcdef"; // validate
const foo: Foo = #{ foo: "abcde" }; // does not
```
[Playground Link](https://typespec.io/playground/?c=bW9kZWwgRm9vIHsKICBAbWF4TGVuZ3RoKDMpCiAgZm9vOiBzdHJpbmc7Cn0KCs4gc2NhbGFyIEJhciBleHRlbmRzySxjb25zdMY%2FxFw9ICN7xg4iYWJjZGUiIH07IC8vIGRvZXMgbm90xzBiYXI6xU89xyhmIsUndmFsaWRhdGUK&e=%40typespec%2Fopenapi3&options=%7B%7D)
Contributor guide
Assessment
This issue has not been assessed yet.