Skip to content

Making Elao Enums work out of the box #2936

@jacraade

Description

@jacraade

Hello.

Using Elao Enums as properties gets the openapi/swagger generator all confused. It always says that the type is string instead of the actual enum type or the type behind the enum (integer in my case). functionally it seems to work fine (as in you pass an integer not a string to the api and it saves it correctly) so that means the enum normalizer does its job.

is there a way to at least make it detect the correct type? (enum support in general seems to be WIP)

currently i'm overwriting it by hand using

     * @ApiProperty(
     *     attributes={
     *         "swagger_context"={"type"="integer"},
     *         "openapi_context"={"type"="integer"}
     *     }
     * )

but thats not optimal.

i suppose this is just how it is right now with enums not supported out of the box but is there a a better way doing it till they are supported?

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