elastic / elastic/sense

Copy as cURL should fix case of verbs to uppercase

Open
#134 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
379
Forks
128
PR merge metrics
No merged PRs in 30d

Description

In sense I can write this and it executes fine:

put _snapshot/local-data/data
{ "indices" : "logstash-*"
}

But if I "Copy as cURL" the *_resulting statement retains the lowercase put *_which then fails to execute

curl -Xput "http://localhost:9200/_snapshot/local-kibana/kibana" -d'
> { "indices" : ".kibana"
> }'
{"error":{"root_cause":[{"type":"snapshot_missing_exception","reason":"[local-kibana:kibana] is missing"}],"type":"snapshot_missing_exception","reason":"[local-kibana:kibana] is missing","caused_by":{"type":"no_such_file_exception","reason":"/mnt/elk1/elasticsearch/snapshots/snap-kibana.dat"}},"status":404}

Would be good if the Copy as cURL could fix this, and maybe just make Sense autofix verbs to uppercase regardless as this seems to be a common cause of issues (c.f. #133 #85)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Sense “Copy as cURL” action and trace how request verbs are parsed and emitted. Check any existing tests for request formatting, then verify that lowercase verbs produce uppercase verbs in copied cURL output and that the proposed editor behavior is covered if included.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.