Repository navigation
Name routes without an operationId after their class in snake_case - #63
Merged
Merged
Conversation
CreateInvoiceCommand becomes command_create_invoice_command instead of command_createinvoicecommand, and the operationId Nelmio derives from it changes with it.
|
Caution Review failedThe pull request is closed. WalkthroughDefault route names derived from command class names now use snake_case. Functional tests, OpenAPI examples, and documentation use the updated names. The changelog describes the naming change and upgrade steps. ChangesDefault command route naming
Priority: Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related PRs
Merge Risk:
|
The documented operationId only has the method prefix by Nelmio's default, an operationId keeps either the route name or the documented one, and area name_patterns may refer to the old names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A route without an
operationIdwas namedcommand_plus the lowercased class short name, soCreateInvoiceCommandbecamecommand_createinvoicecommand. It is now named in snake_case,command_create_invoice_command, consistent with Symfony's own route names. Acronyms and digits are split as Symfony's string component does:ImportCSVFileCommandbecomescommand_import_csv_file_command.Nelmio derives the documented
operationIdof such an operation from the route name, so it changes as well, e.g.post_command_create_invoice_command. Routes with an explicitoperationIdare unaffected.The changelog's Upgrading section covers updating route references and regenerating clients, or setting the previous name as the
operationIdto keep it.Summary by CodeRabbit