Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Getting "Format 'html' not supported, handler must be implemented" on GET requests #721

@medteck

Description

@medteck

When I try to retrieve data with A GET request (ex: /shop-api/products/by-code/abc), I'm getting this response from the API :

{
    "code": 401,
    "message": "Invalid credentials."
}

Here's my configuration in config/packages/_sylius_shop_api.yaml :

imports:
    - { resource: "@SyliusShopApiPlugin/Resources/config/app/config.yml" }
    - { resource: "@SyliusShopApiPlugin/Resources/config/app/sylius_mailer.yml" }

# config/packages/fos_rest.yaml

fos_rest:
    view:
        formats:
            json: true
    format_listener:
        rules:
            - { path: '^/shop-api', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
            - { path: '^/api', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
            - { path: '^/', stop: true }

As you can see, the file is as described in the README of the package.

I tried everything I saw on Stackoverflow (related to api_platform) and none of those solutions worked.

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