-
-
Notifications
You must be signed in to change notification settings - Fork 921
[SymfonyBundle] Fixed the configuration #1563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
->cannotBeEmpty() | ||
->defaultValue('') | ||
->end() | ||
->scalarNode('vesion') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups. Good catch. Thanks (We should never edit code on Github directly :p)
->scalarNode('version') | ||
->info('The version of the API.') | ||
->cannotBeEmpty() | ||
->defaultValue('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to delete the old default value (0.0.0
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shame on me !
The reason: I copy paste the previous block. It's not fixed.
So Sorry
Can you rebase against 2.1, as it's a bug fix? Thanks! |
@dunglas Here we go ;) |
->scalarNode('title') | ||
->info('The title of the API.') | ||
->cannotBeEmpty() | ||
->defaultValue('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it useless given the node that cannot be empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact we must allow empty strings, but not null
. Maybe should be just normalize all empty values to ''
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, the config here is simpler than normalizing everything ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but forbids empty strings, thus breaks with the default value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we must allow empty strings or it will be a big BC break (for instance the Flex recipe doesn’t set those keys).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, looks good 👍
I don't think failing test is related, maybe a rebase would fix CI. |
The value of title/description/version should not be empty. If there are empty, we got the following exception: ``` Type error: Argument 8 passed to ApiPlatform\Core\Bridge\Symfony\Bundle\Action\SwaggerUiAction::__construct() must be of the type string, null given, called in /var/www/server/backend/var/cache/dev/appDevDebugProjectContainer.php on line 1155 ``` How to reproduce: ``` #config.yml api_platform: title: #nothing explicitly ```
I just rebased. |
Thanks @lyrixx ! |
Fix null title/description configuration (#1563 followup)
[SymfonyBundle] Fixed the configuration
Fix null title/description configuration (api-platform#1563 followup)
The value of title/description/version should not be empty.
If there are empty, we got the following exception:
How to reproduce: