Skip to content

Commit

Permalink
Update Dart client, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sas1024 committed Mar 10, 2024
1 parent 50b9215 commit 4558d21
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 15 deletions.
9 changes: 8 additions & 1 deletion dart/dart_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ part '{{ .Part }}.g.dart';
/// {{ . }}
{{- end }}
@JsonSerializable()
class {{ .Type }} {
class {{ .Type }} extends Equatable {
{{- range .Properties }}
{{- range .Description }}
/// {{ . }}
Expand All @@ -30,6 +30,13 @@ class {{ .Type }} {
factory {{ .Type }}.fromJson(Map<String, dynamic> json) =>
_${{ .Type }}FromJson(json);
@override
List<Object?> get props => [
{{- range .Properties }}
{{ .Name }},
{{- end }}
];
}
{{ end }}
Expand Down
31 changes: 27 additions & 4 deletions dart/testdata/client.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/// Code generated from jsonrpc schema by rpcgen v2.4.3; DO NOT EDIT.
/// Code generated from jsonrpc schema by rpcgen v2.4.4; DO NOT EDIT.
import 'package:json_annotation/json_annotation.dart';
import 'package:smd_annotations/annotations.dart';

part 'client.g.dart';

@JsonSerializable()
class Campaign {
class Campaign extends Equatable {
@JsonKey(name: 'groups')
final List<Group> groups;
@JsonKey(name: 'id')
Expand All @@ -21,10 +21,16 @@ class Campaign {

factory Campaign.fromJson(Map<String, dynamic> json) =>
_$CampaignFromJson(json);

@override
List<Object?> get props => [
groups,
id,
];
}

@JsonSerializable()
class Group {
class Group extends Equatable {
@JsonKey(name: 'child')
final Group? child;
@JsonKey(name: 'groups')
Expand All @@ -51,10 +57,20 @@ class Group {

factory Group.fromJson(Map<String, dynamic> json) =>
_$GroupFromJson(json);

@override
List<Object?> get props => [
child,
groups,
id,
nodes,
sub,
title,
];
}

@JsonSerializable()
class SubGroup {
class SubGroup extends Equatable {
@JsonKey(name: 'id')
final int id;
@JsonKey(name: 'nodes')
Expand All @@ -72,6 +88,13 @@ class SubGroup {

factory SubGroup.fromJson(Map<String, dynamic> json) =>
_$SubGroupFromJson(json);

@override
List<Object?> get props => [
id,
nodes,
title,
];
}

@JsonSerializable()
Expand Down
2 changes: 1 addition & 1 deletion gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"golang.org/x/text/language"
)

const version = "2.4.3"
const version = "2.4.4"

const DefinitionsPrefix = "#/definitions/"

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module github.com/vmkteam/rpcgen/v2

go 1.18
go 1.19

require (
github.com/vmkteam/meta-schema/v2 v2.0.1
github.com/vmkteam/zenrpc v1.1.1
github.com/vmkteam/zenrpc/v2 v2.2.11
golang.org/x/text v0.14.0
)

require (
Expand All @@ -20,6 +21,5 @@ require (
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
9 changes: 2 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ github.com/vmkteam/meta-schema/v2 v2.0.1 h1:7eoImKpnCs2wiCcBB8AUCtfVVhGa6L6DDqih
github.com/vmkteam/meta-schema/v2 v2.0.1/go.mod h1:GQzU4Rid0Q9dDIz/OeSDyL/aB/QG7tD0gOUt5nQ4JMk=
github.com/vmkteam/zenrpc v1.1.1 h1:WmModRVCwgs7XEkeJcVvmDOwEtAQk0TuYV91wdpAaCw=
github.com/vmkteam/zenrpc v1.1.1/go.mod h1:x3fCkb9HHOpqwqC7TKXf8pyXWdPxEt2Zrndl50YxexM=
github.com/vmkteam/zenrpc/v2 v2.2.9 h1:J7WnYZEIImOyBhh1DRutJJSCkXcH0tJ7lIn4DSt8fE0=
github.com/vmkteam/zenrpc/v2 v2.2.9/go.mod h1:ZQW8eYsnkWpfq6/lkW4P2NyQafQzamfyb81SXpq3GYs=
github.com/vmkteam/zenrpc/v2 v2.2.11 h1:JfB7QYWhFPXhw9FZuVk5FBwtoVesYscmS3RrSqDK1Zc=
github.com/vmkteam/zenrpc/v2 v2.2.11/go.mod h1:T/ZQlJbKThBNJtyN0313xEPcxjEyB19uNldTBr0o2KE=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -330,8 +328,6 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand All @@ -342,10 +338,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down

0 comments on commit 4558d21

Please sign in to comment.