我确实更改了文件:
--- a/lib/Mojolicious/Plugin/OpenAPI3.pm
+++ b/lib/Mojolicious/Plugin/OpenAPI3.pm
@@ -396,6 +396,7 @@ sub _check_response {
# Here we do not know what to do with all of this.
# Thus we just say: Not Implemented
# $c->stash->{ status } //= 404;
+ DB::x;
$c->render( status => 501, data => '' );
}
当尝试应用存储时,出现错误:
error: Your local changes to the following files would be overwritten by merge:
lib/Mojolicious/Plugin/OpenAPI3.pm
Please commit your changes or stash them before you merge.
但是藏匿处没有相同行的交叉变化:
$ git stash show -p
--- a/lib/Mojolicious/Plugin/OpenAPI3.pm
+++ b/lib/Mojolicious/Plugin/OpenAPI3.pm
@@ -452,6 +463,7 @@ sub validate_response {
# NOTICE: Depending on status we will check normal or error response
my $status = $stash->{ status } //= 200;
my $schema = $stash->{ 'openapi3.schema' }{ responses };
+ $status = 'default' if !$schema->{ $status };
# TODO: Schema also not found for not found request:
# Request which come to not defined path. In this case we should provide
# something like default response, should not?
为什么我得到上面的错误?为什么隐藏的更改只是合并到工作目录中?
答案 0 :(得分:1)
我认为这里的问题是您的工作目录中的文件OpenAPI3.pm
进行了重大更改。直接应用存储可以覆盖其中的某些更改,因此会出现错误消息:
您对以下文件的本地更改将被合并覆盖:
此解决方案遵循上述消息:
请在合并之前提交您的更改或将其保存。
您可以提交更改,也可以进行其他保存。或者,也许您不需要更改,第三个选择是将文件OpenAPI3.pm
重置为最新提交。