metosin/malli

Feature request: enum value descriptions

Open

#613 geöffnet am 10. Jan. 2022

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Clojure (237 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (1.724 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Sometimes, the enumerated values are not clear enough by themselves. It would be nice to have a standard way to provide a description for each enumerated value.

Following our discussion on Slack, a nice solution would be to have :enumn (similar to :catn) that support description of enumerated values, like this:

[:enumn 
   ["foo" {:description "foo means that you don't know how to name things"}] 
   ["bar"] 
   "baz"]

Where some enumerated values have description and some don't.

Open question

Is there a way to pass the description of enumerated values to Swagger? JSON Schema doesn't seem to support description for enumerated values.

Contributor Guide