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

Invalid argument(s): Unknown type on deserialization. Need either specifiedType or discriminator field #17

Closed
jiangzhixiao opened this issue Aug 3, 2018 · 8 comments

Comments

@jiangzhixiao
Copy link

jiangzhixiao commented Aug 3, 2018

@hillelcoren ,i'm using java backend, when i post a login request to the backend,

i got the response:

{data: {accounts: [], version: 5.4, token: null, static: {}}, error: null}

when excute at this line(endities.g.dart line 237):

  result.data.replace(serializers.deserialize(value,
                specifiedType: const FullType(LoginResponseData))
            as LoginResponseData);

i got the error

I/flutter (11099): Deserializing '[data, {accounts: [], version: 5.4, token: null, static: {}}, null, null]' to 'LoginResponse' failed due to: Invalid argument(s): Unknown type on deserialization. Need either specifiedType or discriminator field.

E/flutter (11099): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (11099): type 'DeserializationError' is not a subtype of type 'String'

i have searched by google, still don't quite clear..would you please give me some tips ? thanks hillelcoren.

@hillelcoren
Copy link
Owner

I'd suggest manually checking the sample response can be deserialized.

@jiangzhixiao
Copy link
Author

@hillelcoren sorry ,using the flutter-mobile,not the flutter-redux-starter...

@hillelcoren
Copy link
Owner

You may want to close this issue and open a new one.

What do you mean by 'java backend'?

@jiangzhixiao
Copy link
Author

jiangzhixiao commented Aug 3, 2018

it means my server side code is using java(spring boot ),not the invoice-ninja(PHP).
can i open the issue in flutter-mobile repository ?

@hillelcoren
Copy link
Owner

Are you trying to use the Invoice Ninja mobile app with a different invoicing platform?

I'm sorry, I wouldn't be able to help (and please be sure to follow the license).

@jiangzhixiao
Copy link
Author

jiangzhixiao commented Aug 3, 2018

no,not another invoiceing platform,just a java & flutter demo ,i'm studing flutter.

image

@hillelcoren
Copy link
Owner

hillelcoren commented Aug 3, 2018

I'm sorry, the Invoice Ninja mobile app is only designed to be used with the Invoice Ninja web app.

I'd suggest using the redux starter to make an app rather than the use the invoicing app.

@jiangzhixiao
Copy link
Author

ok, thanks hillelcoren, i change to use redux-stater

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