From 759009e0b50985c68ad6c3883df29bece7c4a6d9 Mon Sep 17 00:00:00 2001 From: Eric Hankins Date: Thu, 11 May 2023 10:47:52 -0500 Subject: [PATCH] Fix typo `resource_id` This should be `get_resource_id`. The method `remove_method_description` was not exercised by the specs so it wasn't caught. (see #864) This was causing apipie to crash during application boot. --- lib/apipie/application.rb | 2 +- spec/dummy/app/controllers/api/v2/architectures_controller.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/apipie/application.rb b/lib/apipie/application.rb index 1e6f8d1f4..418b92f93 100644 --- a/lib/apipie/application.rb +++ b/lib/apipie/application.rb @@ -227,7 +227,7 @@ def get_method_descriptions(resource, method) def remove_method_description(resource, versions, method_name) versions.each do |version| - resource = resource_id(resource) + resource = get_resource_id(resource) if resource_description = get_resource_description("#{version}##{resource}") resource_description.remove_method_description(method_name) end diff --git a/spec/dummy/app/controllers/api/v2/architectures_controller.rb b/spec/dummy/app/controllers/api/v2/architectures_controller.rb index c8b87f780..8eb221b86 100644 --- a/spec/dummy/app/controllers/api/v2/architectures_controller.rb +++ b/spec/dummy/app/controllers/api/v2/architectures_controller.rb @@ -22,7 +22,8 @@ def create def update end - api :DELETE, "/architecturess/:id/", "Delete an architecture." + api! "Delete an architecture." + api_version "2.0" # forces removal of the method description def destroy end end