google / google/json_serializable.dart

JsonConverter with import prefix

Open
#678 4 comments 8 reactions 0 assignees View on GitHub
State: help wanted Type: enhancement
Dominant language
Dart
Stars
1.6k
Forks
461
Avg merge
45m
Merged PRs (30d)
1

Description

I have a `CustomJsonConverter` defined in a separate library which i want to import using a library prefix.

```dart
import 'library.dart' as converter;

@JsonSerializable()
class MyObject {
// ....

@converter.CustomJsonConverter()
final CustomObject value;
}
```

but the generated code uses `CustomJsonConverter.toJson` instead of including the `converter.` library prefix.

Not a big problem, since i could just remove the prefix, but it would be nice if this was supported.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.