microsoft / microsoft/typespec
Make `@pattern` decorator a decorator that can validate values
Open
compiler:core
feature
triaged:core
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Like we already have for `@minValue`, `@minLength`, etc. we could make `@pattern` a known value validator
Would be good to get this
```tsp
@pattern(".+\\@.+\\..+")
scalar email extends string;
const a: email = "abc";
^ error
```
Contributor guide
Assessment
This issue has not been assessed yet.