Skip to content

feat(query): emit the document's query serializer on rest-client 15 - #23

Merged
maxholman merged 5 commits into
masterfrom
feat/query-serializer-emission
Sep 22, 2026
Merged

maxholman merged 5 commits into
masterfrom
feat/query-serializer-emission

Conversation

@maxholman

@maxholman maxholman Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Takes @block65/rest-client 15.0.0 and emits the document's query serializer on each generated command. A major, since generated code now imports serializers that exist only in rest-client 15.

Query serializer emission

A command whose query parameters state a style other than form with explode overrides querySerializer with the rest-client serializer for that style, imported by name (formJoinSerializer, spaceDelimitedSerializer, pipeDelimitedSerializer, deepObjectSerializer). A command that states none inherits formExplodeSerializer, the OpenAPI default. One serializer covers a whole operation, so an operation whose parameters need two of them stops generation with the conflicting pair named.

The docker fixture shows the emission on its two form-without-explode commands. A new serializer test drives the emitted command through rest-client and reads the query back from the URL.

Lint-readiness under shared-config 0.4.0

A consumer with the valibot rule group enabled saw reports on the generated valibot.ts it could do nothing about.

  • defineOverrides now turns off block65/prefer-strict-object, block65/prefer-exact-optional and block65/snake-case-wire-keys for generated files, each with its reason in the shipped source: an object schema is open unless the document closes it, input schemas accept an explicit undefined for a TS caller, and property spelling is the document's wire contract.
  • A real emitter defect fixed on the way: a one-member anyOf or oneOf came out as v.union([member]), and an empty one as v.union([]). The member now stands alone and the empty case is v.unknown(). The openai fixture loses nine such wrappers.
  • The repo's own oxlint config enables the valibot group, so the fixtures lint the way a consumer's do.

Every module the generator writes was swept under the group. Only valibot.ts fired anything.

Release

Follow-up after merge: the 12.0.0 release commit, tag and GitHub Release.

maxholman and others added 5 commits September 22, 2026 20:33
15.0.0 exports one plain serializer per OAS query style, and a command
names the one its document states through the `querySerializer`
property. The generated commands import those by name, so the peer
range moves with the dev dependency.

Co-Authored-By: LLM <noreply@block65.dev>
A command whose query parameters state a style other than form with
explode overrides `querySerializer` with the rest-client serializer for
that style, imported by name. A command that states none inherits
`formExplodeSerializer`, the OpenAPI default. One serializer covers a
whole operation, so an operation whose parameters need two of them
stops generation with the conflicting pair named.

The roundtrip test moves to a serializer test that drives the emitted
command through rest-client and reads the query back from the URL.

Co-Authored-By: LLM <noreply@block65.dev>
A one-member `anyOf` or `oneOf` came out as `v.union([member])`, which
only wraps the member's issues, and an empty one as `v.union([])`,
which fails every input where the document constrains nothing. The
member now stands alone and the empty case is `v.unknown()`.
block65/require-union-options rejects both of the old shapes.

Co-Authored-By: LLM <noreply@block65.dev>
A consumer on shared-config 0.4.0 with the valibot group enabled saw
three rules fire on the generated valibot module that it could do
nothing about. `defineOverrides` now turns them off with the reason for
each: an object schema is open unless the document closes it, input
schemas accept an explicit `undefined` for a TS caller, and property
spelling is the document's wire contract.

The repo's own config enables the group so the fixtures lint the way a
consumer's do.

Co-Authored-By: LLM <noreply@block65.dev>
The docker fixture names `formJoinSerializer` on its two form-without-
explode commands. The openai fixture loses nine one-member unions. The
`#generator` stamp moves in every manifest.

Co-Authored-By: LLM <noreply@block65.dev>
@maxholman
maxholman merged commit cefc46a into master Sep 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant