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

Appearance settings

[Serializer] deserializing array of integers #33784

Copy link
Copy link
Closed
@pauliusrum

Description

@pauliusrum
Issue body actions

Symfony version(s) affected: 4.3.4

Description
Hello, I am trying to deserialize an array of integers but I am getting this exception: Could not denormalize object of type int[], no supporting normalizer found. Previously I was using JMS serializer so it was possible to define type array<int> but I get the same error with symfony serializer.

How to reproduce

<?php
$serializer = new Serializer(
    [new GetSetMethodNormalizer(), new PropertyNormalizer(), new ObjectNormalizer(), new ArrayDenormalizer()],
    [new JsonEncoder()]
);
$numbers  = $serializer->deserialize('["15"]', 'int[]', 'json');

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.