Skip to content

Commit

Permalink
[API] Generator: Use POST for create_service_token when name not present
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Nov 17, 2022
1 parent c398d9a commit 0d0b0bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions elasticsearch-api/utils/thor/generate_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def __endpoint_parts

def __http_method
return '_id ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @endpoint_name == 'index'
return '_name ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST' if @method_name == 'create_service_token'
return post_and_get if @endpoint_name == 'count'

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

0 comments on commit 0d0b0bc

Please sign in to comment.