Skip to content

Errors while Swagger is disabled in Symfony #7596

@ppoz21

Description

@ppoz21

API Platform version(s) affected: 4.2.9

Description
There is an error while Swagger is disabled.
For config file:

when@prod:
    api_platform:
        enable_docs: false
        enable_entrypoint: false
        enable_swagger: false
        enable_swagger_ui: false
        enable_re_doc: false

an error is:

Caution

In DefinitionErrorExceptionPass.php line 51:
You have requested a non-existent parameter "api_platform.enable_swagger_ui". Did you mean one of these: "api_platform.enable_entrypoint", "api_platform.enable_docs"?




For config file without ui an re_doc:

when@prod:
    api_platform:
        enable_docs: false
        enable_entrypoint: false
        enable_swagger: false

an error is:

Caution

In ApiPlatformExtension.php line 586:
You can not enable the Swagger UI without enabling Swagger, fix this by enabling swagger via the configuration "enable_swagger: true".




The only corrent option is:

when@prod:
    api_platform:
        enable_docs: false
        enable_entrypoint: false
        enable_swagger: true
        enable_swagger_ui: false
        enable_re_doc: false

which isn't good, because you have to enable Swagger to disable Swagger UI and ReDoc

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