You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the following input: /session/login: post: tags: - session summary: Endpoint for user-login and getting the session key requestBody: content: application/json: schema: type: object properties: user: type: string pass: type: string format: md5 seq: type: string format: number
using the dio generator it results in the following JSON generation code: @override Iterable<Object?> serialize(Serializers serializers, SessionMobileLoginPostRequest object, {FullType specifiedType = FullType.unspecified}) { final result = <Object?>[]; if (object.user != null) { result ..add(r'user') ..add(serializers.serialize(object.user, specifiedType: const FullType(String))); } if (object.pass != null) { result ..add(r'pass') ..add(serializers.serialize(object.pass, specifiedType: const FullType(String))); } if (object.seq != null) { result ..add(r'seq') ..add(serializers.serialize(object.seq, specifiedType: const FullType(double))); } return result; }
Unfortunately this code is wrong and results in the object being transformed to an array type (which is wrong and the api doesnt accept this).
However using the dart generator the resulting code perfectly fine: Map<String, dynamic> toJson() { final _json = <String, dynamic>{}; if (user != null) { _json[r'user'] = user; } if (pass != null) { _json[r'pass'] = pass; } if (seq != null) { _json[r'seq'] = seq; } return _json; }
The text was updated successfully, but these errors were encountered:
When using the following input:
/session/login: post: tags: - session summary: Endpoint for user-login and getting the session key requestBody: content: application/json: schema: type: object properties: user: type: string pass: type: string format: md5 seq: type: string format: number
using the dio generator it results in the following JSON generation code:
@override Iterable<Object?> serialize(Serializers serializers, SessionMobileLoginPostRequest object, {FullType specifiedType = FullType.unspecified}) { final result = <Object?>[]; if (object.user != null) { result ..add(r'user') ..add(serializers.serialize(object.user, specifiedType: const FullType(String))); } if (object.pass != null) { result ..add(r'pass') ..add(serializers.serialize(object.pass, specifiedType: const FullType(String))); } if (object.seq != null) { result ..add(r'seq') ..add(serializers.serialize(object.seq, specifiedType: const FullType(double))); } return result; }
Unfortunately this code is wrong and results in the object being transformed to an array type (which is wrong and the api doesnt accept this).
However using the dart generator the resulting code perfectly fine:
Map<String, dynamic> toJson() { final _json = <String, dynamic>{}; if (user != null) { _json[r'user'] = user; } if (pass != null) { _json[r'pass'] = pass; } if (seq != null) { _json[r'seq'] = seq; } return _json; }
The text was updated successfully, but these errors were encountered: