Skip to content

Standard compliant PUT not working when enabled in defaults #5361

@nickbg321

Description

@nickbg321

API Platform version(s) affected: 3.1.0

Description
When standard compliant PUT method is enabled in defaults it still continues to behave like PATCH (i.e. the old behavior).

Setting it on resource level instead seems to work as expected:

#[ApiResource(
    shortName: 'Contact',
    operations: [new Get(), new GetCollection(), new Put(), new Post(), new Patch(), new Delete()],
    normalizationContext: ['groups' => [self::READ_GROUP]],
    denormalizationContext: ['groups' => [self::WRITE_GROUP]],
    provider: ContactProvider::class,
    processor: ContactProcessor::class,
    extraProperties: ['standard_put' => true],
)]
final class ContactDto
{

How to reproduce
Enable standard compliant PUT in config/packages/api_platform.yaml by setting it in the defaults section:

api_platform:
    defaults:
        extra_properties:
            standard_put: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions