在API平台中启用ReDoc时出错

问题描述 投票:0回答:1

API平台版本:1.2

这是我目前的api_platform配置文件:

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

启用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".
swagger-ui symfony4 api-platform.com redoc
1个回答
1
投票

您好我遇到了同样的错误。事实证明,API Platform 1.2使用了api-core 2.3.6。

redoc文档将在2.4版本中提供,目前处于测试阶段(请查看https://github.com/api-platform/core/releases以跟踪版本)。

所以你要么必须使用Beta版本,要么保持昂首阔步。

© www.soinside.com 2019 - 2024. All rights reserved.