Skip to content

Constraint traits not rendered when applied directly on enums #1825

@kubukoz

Description

@kubukoz
$version: "2"

namespace input

@length(min: 1)
enum A {
  GOOD
}

output:

val tag: EnumTag[A] = EnumTag.ClosedStringEnum
implicit val schema: Schema[A] = enumeration(tag, values).withId(id).addHints(hints)

https://smithy4s-codegen-ui.fly.dev/index.html#code=CQNwpgTgzglg9gOwFwAIBEAmNAobCCGAtmFAA74DGYKMCpArgC64ACANmAgOaMAWAFIVqoAjAEpsneoRQBBFAG9sKFAHEA8uoAi2AL5A;dependencies=

Notably, Smithy allows it and we already support constraint traits on members that target enums (see #1283), we just skip them on the enum schema itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions