Closed tjlaboss closed 2 years ago
Hi, thanks for using Yamale!
It seems that this can be solved using this syntax:
f"main_course: enum({', '.join(map(repr, main_courses))})"
Does this work for you?
It does, and that is the workaround I am using. Thought it might be cleaner to handle it automatically within validators.Enum
.
I don't think this is something we'd like to support within Yamale. Thank you for your idea though and keep them coming!
All right. Closing the issue.
First of all: thanks for creating Yamale. I love it so far.
It would be useful for the
enum
validator to support argument expansion inside the API. For example,This way,
main_courses
can be defined or generated in the code without rewriting it by hand in the schema.I can take a crack at it if there is interest in such a feature.