Commit 476f5a8 1 parent f7d9af1 commit 476f5a8 Copy full SHA for 476f5a8
File tree 2 files changed +14
-1
lines changed
lib/MusicBrainz/Server/Entity
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
package MusicBrainz::Server::Entity::ExampleRelationship ;
2
2
use Moose;
3
3
4
+ use MusicBrainz::Server::Data::Utils qw( boolean_to_json ) ;
5
+ use MusicBrainz::Server::Entity::Util::JSON qw( to_json_object ) ;
6
+
4
7
has name => (
5
8
isa => ' Str' ,
6
9
required => 1,
@@ -18,4 +21,14 @@ has relationship => (
18
21
required => 1
19
22
);
20
23
24
+ sub TO_JSON {
25
+ my ($self ) = @_ ;
26
+
27
+ return {
28
+ name => $self -> name,
29
+ published => boolean_to_json($self -> published),
30
+ relationship => to_json_object($self -> relationship),
31
+ };
32
+ }
33
+
21
34
1;
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ around TO_JSON => sub {
144
144
$json -> {cardinality1 } = $self -> entity1_cardinality;
145
145
$json -> {deprecated } = boolean_to_json($self -> is_deprecated);
146
146
$json -> {documentation } = $self -> documentation;
147
- $json -> {examples } = $self -> examples;
147
+ $json -> {examples } = to_json_array( $self -> examples) ;
148
148
$json -> {has_dates } = boolean_to_json($self -> has_dates);
149
149
$json -> {id } = $self -> id;
150
150
$json -> {root_id } = $self -> root_id;
You can’t perform that action at this time.
0 commit comments