microsoft / microsoft/typespec

How to create an integer enum

Open
#1,724 11 comments 0 reactions 0 assignees View on GitHub
design:needed
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

The following enum:

```
import "@typespec/rest";
import "@typespec/openapi3";

...

enum DayOfWeek
{
Monday: 0,
Tuesday: 1,
Wednesday: 2,
Thrusday: 3,
Friday: 4,
Saturday: 5,
Sunday: 6
}
```

Generates a `number` enum. Is there any decorator (or way) to force it to an int32 enum? I did try to find something in the documentation without luck.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.