One To Many Relation, Dart Flutter, Database Swagger Codegen
Hey guys,
I am currently working on an project where i have a objectA which consists of many objectB´s. A basic one to many relationship.
Here is some pseudo sql code of the table:
and i to create those types with the swagger codegen: https://pub.dev/packages/swagger_dart_code_generator (please do not mind syntax. the classes have the json serialization annotation correctly)
but the codegen is generating smth like this
which means an postgrest call in dart like this wouldn´t work because objectA.fromJson never reads the value ObjectB:
any reccomendations or best practices on how to solve this?
I am currently working on an project where i have a objectA which consists of many objectB´s. A basic one to many relationship.
Here is some pseudo sql code of the table:
and i to create those types with the swagger codegen: https://pub.dev/packages/swagger_dart_code_generator (please do not mind syntax. the classes have the json serialization annotation correctly)
but the codegen is generating smth like this
which means an postgrest call in dart like this wouldn´t work because objectA.fromJson never reads the value ObjectB:
any reccomendations or best practices on how to solve this?
Dart packages
Have you been turned into a problem with writing code for Http requests? This package can help. It has all of the Http and model codegen functionality you have been looking for.