Azure / Azure/azure-openapi-validator

Disallow non-primitive underlying types for enums

Open
#107 5 comments 0 reactions 0 assignees View on GitHub
enhancement sdk-rule
Dominant language
TypeScript
Stars
53
Forks
57
Avg merge
1d 23h
Merged PRs (30d)
2

Description

OpenAPI specs actually allow us to specify any type as the underlying type for an enum. AutoRest does not support this, not to mention specifying actual complex values in the enum is difficult in itself.
Moreover, with features like extensible enums this would become unyielding and hard to maintain.

tl;dr We need a new validation rule that disallows authors from specifying underlying type as anything other than the primitive types (string, integer, boolean, etc)

Severity should ideally be error since AutoRest has no way of handling complex underlying types
Category should be SDKViolation(?)

@shahabhijeet @fearthecowboy FYI

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.