Я обновил Symfony проект (платформа api) с 4.3 до 4.4, но теперь я получаю эту ошибку в некоторых запросах POST / PUT:
Код состояния: 415 Неподдерживаемый тип носителя
Тип содержимого «application / json» не поддерживается. Поддерживаемые типы MIME: «».
Трассировка с ошибками:
.. / vendor / api-platform / core / src / EventListener / DeserializeListener. php
с помощью команды:
php bin / console debug: config api_platform
api_platform:
path_segment_name_generator: api_platform.path_segment_name_generator.dash
enable_fos_user: true
eager_loading:
force_eager: false
enabled: true
fetch_partial: false
max_joins: 30
http_cache:
max_age: 0
shared_max_age: 3600
vary:
- Content-Type
- Authorization
- Origin
public: true
etag: true
invalidation:
enabled: false
varnish_urls: { }
request_options: { }
oauth:
enabled: true
flow: password
tokenUrl: /api/login
clientId: ''
clientSecret: ''
type: oauth2
authorizationUrl: /oauth/v2/auth
scopes: { }
mapping:
paths:
- /var/www/x/config/packages/apiplatform/user.yml
- /var/www/x/config/packages/apiplatform/business.yml
- /var/www/x/config/packages/apiplatform/service.yml
- /var/www/x/config/packages/apiplatform/customers.yml
- /var/www/x/config/packages/apiplatform/worker.yml
- /var/www/x/src/Entity
title: ''
description: ''
version: 0.0.0
show_webby: true
default_operation_path_resolver: api_platform.operation_path_resolver.unders core
name_converter: null
allow_plain_identifiers: false
validator:
serialize_payload_fields: { }
enable_nelmio_api_doc: false
enable_swagger: true
enable_swagger_ui: true
enable_re_doc: true
enable_entrypoint: true
enable_docs: true
enable_profiler: true
collection:
exists_parameter_name: exists
order: ASC
order_parameter_name: order
pagination:
enabled: true
partial: false
client_enabled: false
client_items_per_page: false
client_partial: false
items_per_page: 30
maximum_items_per_page: null
page_parameter_name: page
enabled_parameter_name: pagination
items_per_page_parameter_name: itemsPerPage
partial_parameter_name: partial
resource_class_directories: { }
doctrine:
enabled: true
doctrine_mongodb_odm:
enabled: false
graphql:
enabled: false
default_ide: graphiql
graphiql:
enabled: false
graphql_playground:
enabled: false
nesting_separator: _
collection:
pagination:
enabled: true
swagger:
versions:
- 2
- 3
api_keys: { }
mercure:
enabled: false
hub_url: null
messenger:
enabled: false
elasticsearch:
enabled: false
hosts: { }
mapping: { }
exception_to_status:
Symfony\Component\Serializer\Exception\ExceptionInterface: 400
ApiPlatform\Core\Exception\InvalidArgumentException: 400
ApiPlatform\Core\Exception\FilterValidationException: 400
Doctrine\ORM\OptimisticLockException: 409
formats:
jsonld:
mime_types:
- application/ld+json
json:
mime_types:
- application/json
html:
mime_types:
- text/html
patch_formats: { }
error_formats:
jsonproblem:
mime_types:
- application/problem+json
jsonld:
mime_types:
- application/ld+json