Repository navigation
Conversation
OpenAPI 3.2 `in: querystring` parameters with a media type other than `application/x-www-form-urlencoded` serialize to the whole query string with no `name=` part, e.g. `?%7B%22numbers%22%3A%5B1%2C2%5D%7D`. `@readme/oas-to-har` writes those as a HAR `queryString` entry with an empty name. `prepare` now keeps empty-name entries out of `queryObj` and appends their values to the query string as-is (percent-encoded unless `harIsAlreadyEncoded`), joined with `&` to any named parameters. Because a raw segment can't be expressed as a params map, a request that has one keeps its whole query string in `url` and gets an empty `queryObj`, so targets that pass `queryObj` to a client's params option send the URL as-is instead. R `httr` now decides whether to emit a query list from `queryObj` rather than the raw HAR `queryString`, and Ruby `faraday` passes the query through `req.params` (with `nil` for a nameless segment) since Faraday rebuilds the query string from its params. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shell integration suite runs these scripts directly, and CI rejected them with permission denied. Co-authored-by: Cursor <cursoragent@cursor.com>
erunion
marked this pull request as ready for review
December 5, 2026 01:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧰 Changes
Adds support for query strings that have no parameter name.
OpenAPI 3.2 lets an
in: querystringparameter be the entire query string. With a media type likeapplication/json,{"numbers":[1,2],"flag":null}serializes to?%7B%22numbers%22%3A%5B1%2C2%5D%2C%22flag%22%3Anull%7D, with noname=.@readme/oas-to-harrepresents that as a HARqueryStringentry with an emptyname. httpsnippet used to turn it into?=%7B..., so@readme/oas-to-snippetstrips those entries before it gets here.httpsnippet now writes these as raw query segments, exactly as given:
queryStringentry with an emptyname, or a URL query segment with no=, is a raw segment. Empty values are ignored.rawQueryarray. Named parameters stay inqueryObj, repeated names included.harIsAlreadyEncodedis set, and percent-encoded otherwise.urlandqueryStringis written once.src/helpers/query.ts.A params map can't hold a raw segment, so clients that build the query from one now send the full URL instead. This covers
javascript:axios,php:http1,php:http2,clojure:clj_http,rust:reqwest,r:httr,shell:httpieandswift:urlsession. Clients that already printfullUrlneeded no change.ruby:faradayis the exception. It writes each raw segment asreq.params['…'] = nil, which Faraday sends as the key with no=. Putting it in the URL would not work because Faraday parses[]there as nested params.r:httralso changes. It decided whether to print a query list by looking at the HARqueryString, so it ignored params that only exist on the URL and dropped any param namedkey. It now uses the params it prints, so both show up (see thequery.r,full.randnested.rfixtures).Known gap:
shell:curlwithglobOff: truerunsunescape()on the URL, which decodes any percent-encoded query value, raw segments included. This PR doesn't change that.🧬 QA & Testing
query-namelessandquery-repeated-namelessrequest fixtures, with expected output for every client. The second mixes repeatedidparams with a raw segment.src/index.test.tsfor encoded and unencoded values, mixing a raw segment with named params (JSON, JSONPath and plaintext likehelloworld), empty values, duplicates acrossurlandqueryString, valueless URL segments, and percent-encoding that differs only by hex case.r:httrcase for a param that only exists on the URL.