Comments (7)
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.
same issue, any solutions ?
from nelmioapidocbundle.
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.
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.
Thanks @DjordyKoert for you feedback 🙏
from nelmioapidocbundle.
zircote/swagger-php#1502 has been merged so a simple update of swagger-php on your project should fix the issue 😄
from nelmioapidocbundle.
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)
- [Bug]: Not all integer range types supported HOT 3
- [Bug]: Object of class Nelmio\ApiDocBundle\Annotation\Model could not be converted to string HOT 4
- [Bug]: Assert\NotBlank is considered regardless of it's group values HOT 1
- [Question]: Discriminator schema with Doctrine ORM Discriminator map HOT 2
- [Feature]: Webhook support
- [RFC]: Adopt Conventional Commits HOT 1
- [Question]: Is it possible to view a web form when mediaType is "application/json"? HOT 2
- [Feature]: FOSRestBundle QueryParam AND nelmio_api_doc.yaml
- [Feature]: FOSRestBundle QueryParam AND nelmio_api_doc.yaml
- [Bug]: @OA\Property excludes property from model's required array HOT 2
- [Bug]: Lost data format in schema for array of objects HOT 1
- [Feature]: Describing default error response
- [Question]: Code breaks after updating from 4.25.2 to 4.25.3 HOT 2
- [Bug]: Upgrade to 4.26.0 breaks phpunit-tests HOT 2
- [Bug]: Deprecation errors after updating to 4.26.1 HOT 4
- [Question]: Is there a way to override the documentation for a specific class/type? HOT 1
- [Bug]: Type required for oneOf defined property HOT 1
- [Question]: multiple allow_origin entries HOT 1
- [Bug]: The PropertyInfo component was not able to guess the type of Company::$edAt. You may need to add a `@var` annotation or use `@OA\Property(type="")` to make its type explicit HOT 1
- [Bug]: Symfony assertions (NotBlank) not working in DTO classes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nelmioapidocbundle.