Skip to content

Swagger Documentation for multi App #2763

@galliroberto

Description

@galliroberto

API Platform version(s) affected: 3.3.310

Description
I am building a multi app as described here
https://symfony.com/doc/current/configuration/multiple_kernels.html
I have 4 apps with dedicated openapi documentation.
Every app has dedicated cache and log.
At the first load everything works fine.
At the second reload all the docs show the same

First load in sequence
image
image

If I relaod the first app
image

Yaml configuration

api_platform.yaml

api_platform:
    title: FixHub api
    version: 1.0.1
    # Mercure integration, remove if unwanted
    mercure:
        include_type: true
    formats:
        jsonapi:  ['application/vnd.api+json']
        jsonld: [ 'application/ld+json' ]
        json: [ 'application/json' ]
    docs_formats:
        jsonapi:  ['application/vnd.api+json']
        jsonld: [ 'application/ld+json' ]
        html: [ 'text/html' ]
    error_formats:
        jsonproblem: [ 'application/problem+json' ]
        jsonapi: [ 'application/vnd.api+json' ]
        jsonld: [ 'application/ld+json' ]      # Hydra error formats
    #resource_class_directories:
    #    - '%kernel.project_dir%/shared/Entity'
    # Good defaults for REST APIs
    ...

First app

api_platform:
    title: FixHub Security Api
    resource_class_directories:
    #    - '%kernel.project_dir%/apps/security/src/Modules/Auth/Entity/'
    defaults:
        namespaces:
            entity: "Security\\Modules\\**\\Entity"
            enum: "Security\\Modules\\**\\Enum"

second app

api_platform:
    title: FixHub Organization Api
    resource_class_directories:
        - '%kernel.project_dir%/apps/organization/src/Modules/Company/Entity/'
        - '%kernel.project_dir%/apps/organization/src/Modules/User/Entity/'
    defaults:
        namespaces:
            entity: "Organization\\Modules\\**\\Entity"
            enum: "Organization\\Modules\\**\\Enum"

How to reproduce

Possible Solution
I don't know how to solve, I have checked the cache and it is different for the 2 apps, they load the right Entity.

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