swagger-uisymfony4api-platform.comredoc

error when enabling ReDoc in API-Platform


API Platform version: 1.2

This is my current api_platform config file:

api_platform:
    enable_swagger_ui: false
    enable_re_doc: true
    mapping:
        paths: ['%kernel.project_dir%/src/Entity']

I got this Error when i enabled ReDoc:

(1/1) InvalidConfigurationException
Unrecognized option "enable_re_doc" under "api_platform". Available options are 
"allow_plain_identifiers", "collection", "default_operation_path_resolver", 
"description", "eager_loading", "enable_docs", "enable_entrypoint", 
"enable_fos_user", "enable_nelmio_api_doc", "enable_profiler", 
"enable_swagger", "enable_swagger_ui", "error_formats", "exception_to_status", 
"formats", "graphql", "http_cache", "mapping", "name_converter", "oauth", 
"path_segment_name_generator", "resource_class_directories", "swagger", 
"title", "validator", "version".

Solution

  • Hello I have encoutered the same error. turns out APIPlatform 1.2 uses the api-core 2.3.6.

    The redoc documentation will be available in version 2.4 which is currently in Beta (check out https://github.com/api-platform/core/releases to track releases).

    So you'll either have to use the Beta version or keep swagger just a little longer.