How to add decorators to items of an array? #4454
-
I can't find a way to apply decorators to items of an array. I'm trying to achieve something like this. I'd like each string in the array to have a minimum length.
I haven't been able to find a way to model this in typespec
|
Beta Was this translation helpful? Give feedback.
Answered by
timotheeguerin
Sep 16, 2024
Replies: 1 comment
-
Only way to do so today is to create a reusable scalar with that info @minLength(3)
scalar myStr extends string;
model Foo {
items: myStr[];
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nonsocode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only way to do so today is to create a reusable scalar with that info