Skip to content

enum type without specifying values #340

Closed
@swamikevala

Description

@swamikevala

I want to define a property as an enum. But I don't want to enter the enum values in the schema. The values will be fetched from a database and will be dynamic in nature.

I want to do something like this:

"TAG": { "type": "enum" }

The schema will be used to auto-generate api code and database queries. (So I need to know that it is an enum property - so the generated code will query the constants table in the db). What is the best way to do this?

I'm currenty followung the openAPI spec, so I'm doing this right now (using a custom extension) :

properties: {
 ...
},
"x-enums": [ "GENDER", "TAG", "COUNTRY" ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Closed

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions