dart-league / dson

dart library which converts Dart Objects into their JSON representation
Apache License 2.0
66 stars 14 forks source link

Does not support enums #8

Closed Pajn closed 9 years ago

Pajn commented 9 years ago

There seems to be no support for enums, which would be nice. Now I get the error

Class 'OrderStatus' has no instance getter 'Todo'.

  NoSuchMethodError: method not found: 'Todo'
  Receiver: Instance of 'OrderStatus'
  Arguments: []
  dart:mirrors                                             _LocalInstanceMirror.getField
  package:dson/src/serializer.dart 124:37                  _pushField
  package:dson/src/serializer.dart 94:9                    _serializeObject.<fn>
  dart:collection                                          _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach
  package:dson/src/serializer.dart 93:23                   _serializeObject
  package:dson/src/serializer.dart 53:12                   objectToSerializable
  package:dson/src/serializer.dart 153:25                  _pushField
  package:dson/src/serializer.dart 94:9                    _serializeObject.<fn>
  dart:collection                                          _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach
  package:dson/src/serializer.dart 93:23                   _serializeObject
  package:dson/src/serializer.dart 53:12                   objectToSerializable
Pajn commented 9 years ago

Actually I get the same error with static variables

Pajn commented 9 years ago

Thanks!

luisvt commented 9 years ago

could you create a new issue with a sample?