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

Falscher Datentyp #2

Closed
valentinmanthei opened this issue Nov 28, 2017 · 4 comments
Closed

Falscher Datentyp #2

valentinmanthei opened this issue Nov 28, 2017 · 4 comments

Comments

@valentinmanthei
Copy link

Danke erstmal für das schöne Package, erleichtert die Arbeit mit der API wirklich sehr!

Ich habe hier folgenden Fehler (Stacktrace gekürzt und sensible Daten entfernt):
(1/1) TypeMismatchException Wrong Type. Expected int got string in ObjectMapper.php (line 144) at ObjectMapper->mapDataToObject(array('Id' => '123534', 'Name' => 'Farbe', 'Value' => 'xxx', 'Price' => 0), 'BillbeeDe\\BillbeeAPI\\Model\\OrderItemAttribute') in ObjectMapper.php (line 246) at ObjectMapper->mapDataToObject(array('TransactionId' => '393663424723', ...))

Habe als Quickfix in OrderItemAttribute die Annotation auf string geändert: @JsonField(name="Id", type="string"). Vielleicht könnt ihr das ja mal ansehen...

@devtronic
Copy link
Member

Danke :-)
Du musst Id einfach zu nem int casten also (int)$variableMitId

@valentinmanthei
Copy link
Author

Naja, das ist schon klar. Allerdings bastle ja aber nicht ich den Request zusammen, sondern da kommt offensichtlich von der API ein string statt int zurück.

@devtronic
Copy link
Member

Ach so, na das ist natürlich was anderes. Schaue ich mir an.

@devtronic
Copy link
Member

@valentinmanthei gefixt in v1.0.1

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

2 participants