Skip to content

SOLR-18460: Ensure all curl commands follow the same pattern - #4925

Open
serhiy-bzhezytskyy wants to merge 1 commit into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18460-curl-format-all
Open

serhiy-bzhezytskyy wants to merge 1 commit into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18460-curl-format-all

Conversation

@serhiy-bzhezytskyy

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-18460

Description

Curl examples across the ref guide were inconsistent: some put the URL after the headers/body instead of right after curl, most kept -X POST alongside -d/--data/--data-binary (redundant, since curl already switches to POST when a body is given), and many started with a $ shell-prompt character that breaks a direct copy-paste.

Solution

Reordered every affected curl example to curl 'URL' -H '...' -d '...' (or the multi-line equivalent for larger JSON bodies), dropped -X POST wherever a body already implies it, and stripped the leading $ from curl lines. Left -X POST in place where there's no body at all (curl defaults to GET and needs the override) and on the one --upload-file/-T example (that flag makes curl default to PUT, not POST, so removing -X POST there would silently change the request).

44 files, all under solr/solr-ref-guide/modules/*/pages/.

Tests

Ran ./gradlew :solr:solr-ref-guide:buildLocalAntoraSite and :checkSiteLinks before and after: same 6 pre-existing warnings (unrelated, tracked in #4922/SOLR-18464), no new ones, no broken links. Re-grepped the whole ref guide for the three rule clauses after the change: 0 remaining curl … -X POST … (-d|--data) combinations, 0 remaining ^$ curl lines.

AI-assisted (Claude Sonnet 5).

Reordered every curl example in the ref guide to curl, URL, headers, then body; dropped -X POST wherever -d/--data/--data-binary already implies it (curl switches to POST on its own); and stripped the leading $ shell-prompt character from curl lines so examples can be copy-pasted directly.
@serhiy-bzhezytskyy

Copy link
Copy Markdown
Contributor Author

@epugh tagging you since this is under SOLR-18459/SOLR-18460, which you filed.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 20, 2026

@epugh epugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM! I'm going to ping Jan and David as they may have opinons on the overall structure we chose, but the mechanics of this look great. I like all the clean ups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants