Skip to content

[2.5.8] assertMatchesResourceItemJsonSchema with DateTime Format "U" #3878

Description

@BeyerJC

API Platform version(s) affected: 2.5.8

Description
Not 100% sure its a bug but I have an embeddable with an attribute private ?DateTimeInterface $startDateTime;
and Im decorating the SerializerContextBuilder to use datetime_format="U". After the changes in assertMatchesResourceItemJsonSchema my tests are now failing because the response contains an timestamp.

timeRange.startDateTime: Invalid date-time "1606994586", expected format YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss+hh:mm

The Endpoint itself still works and returns the object as

'timeRange' => Array &1 (
        '@type' => 'TimeRange'
        '@id' => '_:11331'
        'startDateTime' => '1606994586'
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions