swagger-core
swagger-core copied to clipboard
Question: Is there a way to specify allowableValues dynamically?
Hello,
Is there any way to provide allowableValues() for annotation Parameter dynamically (e.g from property file or DB)?
@Operation(summary = "Retrieve a list of entities")
@GetMapping
public List<Entity> get(@Parameter(schema = @Schema(allowableValues = "OneOfThePossibleValuesOfEnum")) EntityTypeEnum entityType) {
...
}
In this example, I would like to have in the documentation, not all values or listed there but being able to populate them from another resource.
any update for this question please,
Did not find a solution yet
Have a look at the ReaderListener interface - you can use an implementation of this interface to modify/customize the OpenAPI instance at runtime