0

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".
4

1 回答 1

1

您好,我遇到了同样的错误。原来 APIPlatform 1.2 使用 api-core 2.3.6。

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

因此,您要么必须使用 Beta 版本,要么保持招摇长一点。

于 2019-03-12T11:25:32.157 回答