Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Serializer] Deprecate CsvEncoder as_collection false default value#27715

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromogizanagi:serializer/deprecate_as_collection_false_default
Jun 30, 2018
Merged

[Serializer] Deprecate CsvEncoder as_collection false default value#27715

fabpot merged 1 commit intosymfony:masterfromogizanagi:serializer/deprecate_as_collection_false_default
Jun 30, 2018

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedJun 25, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

As already expressed in#25369 and related issues, this behavior is quite counter-intuitive. It may be fine for write-API with a single document in the body but I think such CSV APIs are way less common than file-based ones, expecting collections. So I think this behavior should be opt-in explicitly in required cases, always dealing with collections by default.
This is still an arbitrary decision, but trying to make it based on use-cases and user's experience with CSV.

Note: perhaps we could find a better name for this as the semantic of settingas_collection tofalse to get the single row directly would not be really obvious.
Also, it could throw an exception when getting multiple rows where only one was expected.

ostrolucky, jvasseur, and ro0NL reacted with thumbs up emoji
@nicolas-grekas
Copy link
Member

(rebase needed)

@ogizanagi
Copy link
ContributorAuthor

Rebased

fabpot
fabpot previously requested changesJun 30, 2018
--------------

* The`lazy` attribute on`doctrine.event_listener` tags was removed.
Listeners are now lazy by default. So any`lazy` attributes can safely be removed from those tags.
Copy link
Member

Choose a reason for hiding this comment

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

Does not seem related to this PR.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, indeed. It's just to respect the alpha order we use on UPGRADE files.
I can do another PR if you want, but IIRC we already accepted such changes inside unrelated PRs in the past.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@ogizanagiogizanagi dismissedfabpot’sstale reviewJune 30, 2018 08:40

Unrelated changed reverted :)

@fabpot
Copy link
Member

Thank you@ogizanagi.

@fabpotfabpot merged commitbce59c8 intosymfony:masterJun 30, 2018
fabpot added a commit that referenced this pull requestJun 30, 2018
…default value (ogizanagi)This PR was merged into the 4.2-dev branch.Discussion----------[Serializer] Deprecate CsvEncoder as_collection false default value| Q             | A| ------------- | ---| Branch?       | master <!-- see below -->| Bug fix?      | no| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | N/AAs already expressed in#25369 and related issues, this behavior is quite counter-intuitive. It may be fine for write-API with a single document in the body but I think such CSV APIs are way less common than file-based ones, expecting collections. So I think this behavior should be opt-in explicitly in required cases, always dealing with collections by default.This is still an arbitrary decision, but trying to make it based on use-cases and user's experience with CSV.Note: perhaps we could find a better name for this as the semantic of setting `as_collection` to `false` to get the single row directly would not be really obvious.Also, it could throw an exception when getting multiple rows where only one was expected.Commits-------bce59c8 [Serializer] Deprecate CsvEncoder as_collection false default value
@ogizanagiogizanagi deleted the serializer/deprecate_as_collection_false_default branchJune 30, 2018 09:28
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
This was referencedNov 3, 2018
nicolas-grekas added a commit that referenced this pull requestMay 29, 2019
…on & change default value (ogizanagi)This PR was merged into the 5.0-dev branch.Discussion----------[Serializer] Remove CsvEncoder "as_collection" deprecation & change default value| Q             | A| ------------- | ---| Branch?       | master <!-- see below -->| Bug fix?      | no| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes  (AppVeyor failure unrelated. Seehttps://github.com/symfony/symfony/pull/31685/files)  <!-- please add some, will be required by reviewers -->| Fixed tickets |#27715   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | N/A <!-- required for new features -->As planned in#27715Commits-------22dd071 [Serializer] Remove CsvEncoder "as_collection" deprecation & change default value
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@dunglasdunglasdunglas approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@srozesrozesroze approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

7 participants

@ogizanagi@nicolas-grekas@fabpot@dunglas@sroze@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp