Skip to content

allowableValues extends in stead of replaces allowed values #3566

@jlous

Description

@jlous

Awaiting restored support for @JsonProperty/@jsonvalue in enums (#3553), I tried to work around the issue using @Schema and allowableValues, but it turns out this only adds to the set of allowed values, and does not replace the Java names, which my API does not actually support.

Java code:

@Schema(allowableValues = {"num-one", "num-two"})
public enum SomeEnum {
  @JsonProperty("num-one")
  NUMONE,
	
  @JsonProperty("num-two")
  NUMTWO
}

Expected in OpenApi schema:
enum: ["num-one", "num-two"]
actual:
enum: ["NUMONE", "NUMTWO", "num-one", "num-two"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions