Skip to content

Add "application/vnd.api+json" support for #[MapRequestPayload] #60701

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
LeikoDmitry opened this issue Jun 5, 2025 · 0 comments
Open

Add "application/vnd.api+json" support for #[MapRequestPayload] #60701

LeikoDmitry opened this issue Jun 5, 2025 · 0 comments

Comments

@LeikoDmitry
Copy link

LeikoDmitry commented Jun 5, 2025

Symfony version(s) affected

7.1

Description

In our project we use header “application/vnd.api+json” for REST API and when we call the required controller we get “Unsupported format” exception. Is it possible to make an additional parameter in the future so that we can specify the required “Content-type”?

How to reproduce

Add header Content-Type with application/vnd.api+json

Possible Solution

MapRequestPayload.php

public function __construct(
        public readonly array|string|null $acceptFormat = null,
        public readonly array $serializationContext = [],
        public readonly string|GroupSequence|array|null $validationGroups = null,
        string $resolver = RequestPayloadValueResolver::class,
        public readonly int $validationFailedStatusCode = Response::HTTP_UNPROCESSABLE_ENTITY,
        public readonly ?string $type = null,
        public readonly ?string $contentType = null,
    ) {
        parent::__construct($resolver);
    }

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants