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:
Cole Helbling 2021-04-28 12:16:13 -07:00 committed by Graham Christensen
parent 29028258e3
commit fff0db10e3

View file

@ -10,6 +10,10 @@ use JSON;
sub TO_JSON {
my $self = shift;
if ($self->can("as_json")) {
return $self->as_json();
}
my $hint = $self->json_hint;
my %json = ();