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] Document Normalizers#10515

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
javiereguiluz merged 1 commit intosymfony:2.8fromlyrixx:serializer-normalizer
Oct 23, 2018

Conversation

@lyrixx
Copy link
Member

@lyrixxlyrixx commentedOct 18, 2018
edited
Loading

refs#10505

.. index::
single: Serializer; Custom normalizers

How to Create your Custom Normalizer

This comment was marked as resolved.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I copied the schema ofhttps://symfony.com/doc/current/serializer/custom_encoders.html ; So are you sure I should be not consistant with existing documentation?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, lets keep it then 👍

private $router;
private $normaliser;

public function __construct(UrlGeneratorInterface $router, ObjectNormalizer $normaliser)
Copy link
Contributor

Choose a reason for hiding this comment

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

s/$normaliser/$normalizer/


namespace AppBundle\Serializer;

use App\Entity\Topic;
Copy link
Contributor

Choose a reason for hiding this comment

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

you useApp here, but 2 lines above you are inAppBundle namespace, maybe a mistake?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

yes, good catch :) thanks

OskarStark reacted with thumbs up emoji
}
}

Registering it in your app

Choose a reason for hiding this comment

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

A question for when we merge this into upper branches. Does Symfony autoconfiguration support Normalizers? Thanks!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes it does ❤️
I already planned to open a new PR to remove theses for new Symfony versions

@javiereguiluzjaviereguiluz merged commitaa4a747 intosymfony:2.8Oct 23, 2018
javiereguiluz added a commit that referenced this pull requestOct 23, 2018
This PR was merged into the 2.8 branch.Discussion----------[Serializer] Document Normalizersrefs#10505Commits-------aa4a747 [Serializer] Document Normalizers
@javiereguiluz
Copy link
Member

Thanks Grégoire! This has been merged now.

OskarStark reacted with thumbs up emoji

@lyrixxlyrixx deleted the serializer-normalizer branchOctober 23, 2018 12:04
@javiereguiluz
Copy link
Member

The change it's now merged in all branches. Next steps would be:

  • A PR to 3.4 to changeAppBundle ->App
  • Later: a PR to 4.1 to simplify things and rely on service autoconfiguration.

Thanks!

@lyrixx
Copy link
MemberAuthor

I have opened#10543 before reading your last comment.
I have documented in 3.4 the auto-configure part. It was done also for the encoder. Did I miss something ?
(let's continue this discussion if needed in#10543)

Thanks for the merge BTW

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

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@OskarStarkOskarStarkOskarStark approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@lyrixx@javiereguiluz@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp