Skip to content

Commit 0d0b0bc

Browse files
committed
[API] Generator: Use POST for create_service_token when name not present
1 parent c398d9a commit 0d0b0bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

elasticsearch-api/utils/thor/generate_source.rb

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def __endpoint_parts
171171

172172
def __http_method
173173
return '_id ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @endpoint_name == 'index'
174+
return '_name ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @method_name == 'create_service_token'
174175
return post_and_get if @endpoint_name == 'count'
175176

176177
default_method = @spec['url']['paths'].map { |a| a['methods'] }.flatten.first

0 commit comments

Comments
 (0)