Skip to content

Issue with #7273 after update to 4.1.8 #7287

Open
@temp

Description

@temp

API Platform version(s) affected: 4.1.8

Description
My functional tests fail after the update, I have xml format disabled (only application/json available), but a request with accept: text/xml responds with xml. Which it shouldn't, IMHO, since only json is enabled.

Failed asserting that 'application/xml; charset=utf-8' [ASCII](length: 30) contains "application/problem+json" [ASCII](length: 24).

How to reproduce
Format config from my project:

    formats:
        json: [ 'application/json', 'application/json;version=1.0' ]
        html: [ 'text/html' ]
        multipart: [ 'multipart/form-data' ]
    patch_formats:
        json: ['application/json']
    error_formats:
        jsonproblem: [ 'application/problem+json' ]
    docs_formats:
        jsonopenapi: [ 'application/vnd.openapi+json' ]
        html: [ 'text/html' ]

Possible Solution
Check if xml format is enabled.

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