Skip to content

Add @minValue/ @maxValue support for date time types #8476

Description

Describe the bug

Applying the @minValue decorator on a unixTimestamp32 does not compile, although that type is supposed to be numeric (an int32), e.g.

model Foo {
    // Cannot apply @minValue decorator to type it is not a numericTypeSpec(decorator-wrong-target)
    @minValue(1758023189)
    stamp: unixTimestamp32;
}

Reproduction

https://typespec.io/playground/?e=%40typespec%2Fopenapi3&c=bW9kZWwgRm9vIHsKICAgIC8vIENhbm5vdCBhcHBseSBAbWluVmFsdWUgZGVjb3JhdG9yIHRvIHR5cGUgaXQgaXMgxSwgbnVtZXJpY1R5cGVTcGVjKMkuLXdyb25nLXRhcmdldCnFZMlUKDE3NTgwMjMxODnGGnN0YW1wOiB1bml4VGltZcUPMzI7Cn0K&options=%7B%7D&vs=%7B%7D

Checklist

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

compiler:coreIssues for @typespec/compilerdesign:acceptedProposal for design has been discussed and accepted.triaged:core

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions