diff --git a/lib/Mojolicious/Plugin/Yancy.pm b/lib/Mojolicious/Plugin/Yancy.pm index 5cbe6f76..da74eccc 100644 --- a/lib/Mojolicious/Plugin/Yancy.pm +++ b/lib/Mojolicious/Plugin/Yancy.pm @@ -585,6 +585,7 @@ sub _openapi_spec_infer_mojo { @{ $op_spec->{parameters} || [] }, ; my ($id_field) = grep defined, + (map $_->{'x-id-field'}, $op_spec, $pathspec), (@path_params && $path_params[-1]{name}); my %base_spec = ( controller => $api_controller, diff --git a/lib/Yancy/Help/Config.pod b/lib/Yancy/Help/Config.pod index dce5e8d6..7c915cf7 100644 --- a/lib/Yancy/Help/Config.pod +++ b/lib/Yancy/Help/Config.pod @@ -461,9 +461,13 @@ an error. To derive which collection, these things are considered: Each operation infers from the HTTP method plus other information which method of L it should connect to. -The C parameter is the C of the last C parameter -specified in the operation's spec. Every operation type except C -in "list" mode, and C, needs an C parameter. + +The C stash parameter is either the value of the C +key in the operation or path spec, or if not given, the C of the +last C parameter specified in the operation's spec. Every +operation type except C in "list" mode, and C, needs an +C parameter. This is what the controller will pass as the C +to the relevant L method. =head1 Additional Configuration