Open Mohana-Krishna-N opened 5 months ago
When we try to generated the autorest for the union with type int[int32] It generates the type: number
Sample model:
union PollingIntervalInSeconds { @doc("30 PollingIntervalInSeconds") Thirty: 30, @doc("60 PollingIntervalInSeconds") sixty: 60, @doc("90 PollingIntervalInSeconds") Ninety: 90, @doc("120 PollingIntervalInSeconds") OneTwenty: 120, int32, }
Actual output:
"pollingIntervalInSeconds": { "type": "number", "description": "Polling interval in seconds.", "default": 30, "enum": [ 30, 60, 90, 120 ], "x-ms-enum": { "name": "PollingIntervalInSeconds", "modelAsString": true, },
Expected output: Should have "type": "int", "format": "int32" as shown below.
"pollingIntervalInSeconds": { "type": "int", "format": "int32", "description": "Polling interval in seconds.", "default": 30, "enum": [ 30, 60, 90, 120 ], "x-ms-enum": { "name": "PollingIntervalInSeconds", "modelAsString": true, },
link to new issue on literal type resolution
Describe the bug
When we try to generated the autorest for the union with type int[int32] It generates the type: number
Reproduction
Sample model:
Actual output:
Expected output: Should have "type": "int", "format": "int32" as shown below.
Checklist