Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Typo3 flow with doctrine error #359

Closed
zeConehead opened this issue Jan 12, 2017 · 7 comments
Closed

Problems with Typo3 flow with doctrine error #359

zeConehead opened this issue Jan 12, 2017 · 7 comments

Comments

@zeConehead
Copy link

In my project I am using Typo3 Flow framework.
As soon as I use this package and add some @swg annotations to it,
it does not load anymore.
I get the following error:

User Notice: Property "_types" doesn't exist in a @SWG\Xml(), exising properties: "name", "namespace", "prefix", "attribute", "wrapped", "x", "_context", "_unmerged" in \Doctrine\Common\Annotations\DocParser->Annotation() in /docker/Packages/Libraries/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php on line 816 in /docker/Packages/Libraries/zircote/swagger-php/src/Logger.php line 38
backend_1        | Type: TYPO3\Flow\Error\Exception
backend_1        |   Code: 1
backend_1        |   File:
backend_1        | Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Error/ErrorHandler.php
backend_1        |   Line: 81

Looks like the combination of Doctrine and swagger-php is making trouble.
Already tried to add

@ignoreAnnotation

and

AnnotationReader::addGlobalIgnoredName('SWG\Model');
...

Any ideas what the problem could be?

@bfanger
Copy link
Collaborator

bfanger commented May 20, 2017

I've tried to recreate the bug by setting up a website with the Typo3 Flow framework.
I used "neos/flow" 4.1.0 and didn't encounter the issue you're describing.

Property _types does exists in a @SWG\Xml() but its an static public property, it could also be a php version specific issue (I'm using PHP 7.1.4).

@johannessteu
Copy link

I just got a similar issue in my neos/flow app:
User Notice: Property "_required" doesn't exist in a @SWG\Info(), exising properties: "title", "description", "termsOfService", "contact", "license", "version", "x", "_context", "_unmerged"

I'm using PHP 7.0.19 so probably really a php related problem @bfanger ?

@johannessteu
Copy link

Looks like https://github.com/zircote/swagger-php/blob/master/src/Annotations/AbstractAnnotation.php#L129 uses get_object_vars wich won't find a public static property >.>

@johannessteu
Copy link

@bfanger @zeConehead the issue is located here:
Flow uses get_class_vars() and this project get_object_vars.
https://github.com/neos/flow-development-collection/blob/master/Neos.Flow/Classes/ObjectManagement/Proxy/Compiler.php#L296

@bfanger any reason to not use get_class_vars here?

@bfanger
Copy link
Collaborator

bfanger commented May 22, 2017

You found the bug in Flow's Compiler.php as get_class_vars() includes static properties.

You can use reflection to determine if a property is static.

@wedi
Copy link

wedi commented Sep 16, 2019

I just stumpled over this issue and I don't understand how to solve it from what is documented here and in #675. It would be nice if someone could point me into the right direction.

swagger-php 3.0.2, Neos Flow 5.3.4, PHP 7.1.23

Unfortunately, my google foo reveals almost no ressources about how to use swagger-php with Neos Flow.

User Notice: Property "_required" doesn't exist in a @OA\Info(), existing properties: "title", "description", "termsOfService", "contact", "license", "version", "x", "_context", "_unmerged" in \Doctrine\Common\Annotations\DocParser->Annotation() in /Users/weise/code/test-project/Packages/Libraries/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php on line 827 in /Users/weise/code/test-project/Packages/Libraries/zircote/swagger-php/src/Logger.php line 39

@albe
Copy link

albe commented Dec 10, 2020

Note: I only got aware of this issue today and @bfanger was indeed right, that we were wrongly accessing static properties. This will be fixed in the upcoming Flow bugfix releases 5.3.x+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants