forked from lix-project/hydra
ToJSON: allow custom as_json function
This allows us to modify what the API responds with, which in turn lets us unify the OpenAPI specification and the actual API's responses.
This commit is contained in:
parent
29028258e3
commit
fff0db10e3
|
@ -10,6 +10,10 @@ use JSON;
|
||||||
sub TO_JSON {
|
sub TO_JSON {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
if ($self->can("as_json")) {
|
||||||
|
return $self->as_json();
|
||||||
|
}
|
||||||
|
|
||||||
my $hint = $self->json_hint;
|
my $hint = $self->json_hint;
|
||||||
|
|
||||||
my %json = ();
|
my %json = ();
|
||||||
|
|
Loading…
Reference in a new issue