1
votes

I am trying to create admin panel for my API, so I decided to generate API Platform Admin.

I managed all problems with CORS and authentication, but I still get "Unable to retrieve API documentation.". There are no errors in "network" section of developer tools.

My CORS settings:

nelmio_cors:
defaults:
    origin_regex: true
    allow_origin: ['*']
    allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
    allow_headers: ['Content-Type', 'Authorization', 'X-Access-Token']
    expose_headers: ['Link']
    max_age: 3600
paths:
    '^/': ~

Any idea on how to resolve this?

no errors in developer tools

1

1 Answers

0
votes

If you are using the Api Platform distribution, it uses docker-compose, so when is running on "localhost", your Browser (I bet Chrome) is blocking the request the first time.

Solution: try the "https" version (https://localhost:8443/) of your API.

Important: check that you can access the API "home" without authentication (http://localhost:8080/ & https://localhost:8443/)