jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
54 stars 42 forks source link

$c->validation->output not supported in v3 #162

Closed Skeeve closed 4 years ago

Skeeve commented 4 years ago

Documentation is incorrect in

https://metacpan.org/pod/distribution/Mojolicious-Plugin-OpenAPI/lib/Mojolicious/Plugin/OpenAPI/Guides/OpenAPIv3.pod#Controller

$c->validation->output gives an empty object.

Skeeve commented 4 years ago

I'm referring to

  # $c->openapi->valid_input copies valid data to validation object,
  # and the normal Mojolicious api works as well.
  my $input = $c->validation->output;
  my $age   = $c->param("age"); # same as $input->{age}
  my $body  = $c->req->json;    # same as $input->{body}

I used this API Spec http://paste.scsys.co.uk/587948

In my test code http://paste.scsys.co.uk/587951

$c->validation->output was empty

jhthorsen commented 4 years ago

Fixed by slowing removing support for $c->validation->output altogether.