Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alanpoulain
Copy link
Member

Supersedes #4857.

Partially fixes #2254.

@alanpoulain alanpoulain force-pushed the feat/openapi-enum-support branch from f4c541a to 6cf2146 Compare November 7, 2022 16:19
@alanpoulain alanpoulain merged commit f1ecc30 into api-platform:main Nov 7, 2022
$enumType = new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, $enumClass);
}

switch ($typeOfField) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we use match here ?

$typeOfField = $metadata->getTypeOfField($property);
$nullable = $metadata instanceof MongoDbClassMetadata && $metadata->isNullable($property);
$enumType = null;
if (null !== $enumClass = $metadata instanceof MongoDbClassMetadata ? $metadata->getFieldMapping($property)['enumType'] ?? null : null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we try to avoid multiple conditions in an if

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Enums

2 participants