Skip to content

Example documentation is ignored for Enum resources #6317

Description

@gnito-org

API Platform version(s) affected: 3.2.20

Description

When using a Backed Enum class as an API resource, any example value provided in the ApiProperty attribute is ignored and does not appear in the OpenAPI documentation.

This is true for example: 'foo' and openapiContext: ['example' => 'foo'].

On API resources that are Doctrine entities, the supplied example values appear in the OpenAPI documentation.

How to reproduce

https://github.com/gnito-org/problem-replicator-api-platform-enum-example

Possible Solution

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions