feat(query): emit the document's query serializer on rest-client 15 - #23
Merged
Merged
Conversation
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>
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.
Takes
@block65/rest-client15.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
querySerializerwith the rest-client serializer for that style, imported by name (formJoinSerializer,spaceDelimitedSerializer,pipeDelimitedSerializer,deepObjectSerializer). A command that states none inheritsformExplodeSerializer, 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.tsit could do nothing about.defineOverridesnow turns offblock65/prefer-strict-object,block65/prefer-exact-optionalandblock65/snake-case-wire-keysfor generated files, each with its reason in the shipped source: an object schema is open unless the document closes it, input schemas accept an explicitundefinedfor a TS caller, and property spelling is the document's wire contract.anyOforoneOfcame out asv.union([member]), and an empty one asv.union([]). The member now stands alone and the empty case isv.unknown(). The openai fixture loses nine such wrappers.Every module the generator writes was swept under the group. Only
valibot.tsfired anything.Release
Follow-up after merge: the
12.0.0release commit, tag and GitHub Release.