GithubHelp home page GithubHelp logo

Comments (7)

DjordyKoert avatar DjordyKoert commented on June 13, 2024 2

I have a work in progress PR open at zircote/swagger-php zircote/swagger-php#1502.

This happens because Api platform 3.2 creates documentation according to openapi spec 3.1.0 which allows types to be defined as a string or a list of types. A list of types causes a TypeError because that method only accepts string as a parameter but an arrar (list of types) is passed instead.

from nelmioapidocbundle.

Dayvin30 avatar Dayvin30 commented on June 13, 2024

same issue, any solutions ?

from nelmioapidocbundle.

xammmue avatar xammmue commented on June 13, 2024

I got the same issue when upgrading from Api platform 2.7 to ApiPlatform 3.2. Looking forward to finding a solution here.

TypeError : OpenApi\Analysis::getSchemaForSource(): Argument #1 ($fqdn) must be of type string, array given, called in /var/www/symfony/vendor/zircote/swagger-php/src/Processors/AugmentSchemas.php on line 106

We are using these versions:

api-platform/core 3.2.5
nelmio/api-doc-bundle 4.12.0
zircote/swagger-php 4.7.15

There is an issue in zircote/swagger-php which got closed as it was deemed as unrelated to their project: zircote/swagger-php#1464

Looking forward to finding a solution here

from nelmioapidocbundle.

sauls avatar sauls commented on June 13, 2024

Maybe we can have temporary solution by introducing configuration like enable_api_platform.

So instead in DependencyInjection/NelmioApiDocExtension.php:170-173

// ApiPlatform support
if (isset($bundles['ApiPlatformBundle']) && class_exists('ApiPlatform\Documentation\Documentation')) {
    $loader->load('api_platform.xml');
}

Would be nice not to force api platform integration

// ApiPlatform support
if ($config['enable_api_platform'] && isset($bundles['ApiPlatformBundle']) && class_exists('ApiPlatform\Documentation\Documentation')) {
    $loader->load('api_platform.xml');
}

I know this doesn't fix the problem, but at least having this option we can have separate UIs that work, until the problem is fixed.

My project use case is that v1 is under nelmio api docs , and we are moving to v2 using api-platform, both docs are rendered separately. So now only v2 renders correctly while v1 gets this exception too... And if I comment out these lines, v1 and v2 docs are rendered without any issues.

from nelmioapidocbundle.

jdechavanne avatar jdechavanne commented on June 13, 2024

Thanks @DjordyKoert for you feedback 🙏

from nelmioapidocbundle.

DjordyKoert avatar DjordyKoert commented on June 13, 2024

zircote/swagger-php#1502 has been merged so a simple update of swagger-php on your project should fix the issue 😄

from nelmioapidocbundle.

jdechavanne avatar jdechavanne commented on June 13, 2024

Thanks @DjordyKoert
I have another error now, Warning: Undefined array key "owl:maxCardinality"

But i don't think it's related 🤔

from nelmioapidocbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.