From 4558d2144724ea398f5a1486ec94c453ed7b68df Mon Sep 17 00:00:00 2001 From: Alexander Korelskiy Date: Mon, 11 Mar 2024 01:06:04 +0300 Subject: [PATCH] Update Dart client, update dependencies --- dart/dart_template.go | 9 ++++++++- dart/testdata/client.dart | 31 +++++++++++++++++++++++++++---- gen/gen.go | 2 +- go.mod | 4 ++-- go.sum | 9 ++------- 5 files changed, 40 insertions(+), 15 deletions(-) diff --git a/dart/dart_template.go b/dart/dart_template.go index 49356f7..1a3c397 100644 --- a/dart/dart_template.go +++ b/dart/dart_template.go @@ -11,7 +11,7 @@ part '{{ .Part }}.g.dart'; /// {{ . }} {{- end }} @JsonSerializable() -class {{ .Type }} { +class {{ .Type }} extends Equatable { {{- range .Properties }} {{- range .Description }} /// {{ . }} @@ -30,6 +30,13 @@ class {{ .Type }} { factory {{ .Type }}.fromJson(Map json) => _${{ .Type }}FromJson(json); + + @override + List get props => [ + {{- range .Properties }} + {{ .Name }}, + {{- end }} + ]; } {{ end }} diff --git a/dart/testdata/client.dart b/dart/testdata/client.dart index f9d1500..2cc10d5 100755 --- a/dart/testdata/client.dart +++ b/dart/testdata/client.dart @@ -1,4 +1,4 @@ -/// 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'; @@ -6,7 +6,7 @@ import 'package:smd_annotations/annotations.dart'; part 'client.g.dart'; @JsonSerializable() -class Campaign { +class Campaign extends Equatable { @JsonKey(name: 'groups') final List groups; @JsonKey(name: 'id') @@ -21,10 +21,16 @@ class Campaign { factory Campaign.fromJson(Map json) => _$CampaignFromJson(json); + + @override + List get props => [ + groups, + id, + ]; } @JsonSerializable() -class Group { +class Group extends Equatable { @JsonKey(name: 'child') final Group? child; @JsonKey(name: 'groups') @@ -51,10 +57,20 @@ class Group { factory Group.fromJson(Map json) => _$GroupFromJson(json); + + @override + List get props => [ + child, + groups, + id, + nodes, + sub, + title, + ]; } @JsonSerializable() -class SubGroup { +class SubGroup extends Equatable { @JsonKey(name: 'id') final int id; @JsonKey(name: 'nodes') @@ -72,6 +88,13 @@ class SubGroup { factory SubGroup.fromJson(Map json) => _$SubGroupFromJson(json); + + @override + List get props => [ + id, + nodes, + title, + ]; } @JsonSerializable() diff --git a/gen/gen.go b/gen/gen.go index b37becc..9b636ac 100644 --- a/gen/gen.go +++ b/gen/gen.go @@ -10,7 +10,7 @@ import ( "golang.org/x/text/language" ) -const version = "2.4.3" +const version = "2.4.4" const DefinitionsPrefix = "#/definitions/" diff --git a/go.mod b/go.mod index 7d3ad6a..e57b25e 100644 --- a/go.mod +++ b/go.mod @@ -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 ( @@ -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 ) diff --git a/go.sum b/go.sum index cf78e88..f5a692e 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= @@ -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=