diff --git a/elasticsearch-api/utils/thor/generate_source.rb b/elasticsearch-api/utils/thor/generate_source.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-api/utils/thor/generate_source.rb
+++ b/elasticsearch-api/utils/thor/generate_source.rb
@@ -161,6 +161,7 @@ module Elasticsearch
 
       def __parse_path(path)
         path.gsub(/^\//, '')
+            .gsub(/\/$/, '')
             .gsub('{', '#{Elasticsearch::API::Utils.__listify(_')
             .gsub('}', ')}')
       end
[API] Generator: remove trailing / from paths