Skip to content

feat: add -webrpcHeader opt-out + exercise Quantity alias#2

Open
klaidliadon wants to merge 1 commit into
webrpc:masterfrom
klaidliadon:feat/python-parity
Open

feat: add -webrpcHeader opt-out + exercise Quantity alias#2
klaidliadon wants to merge 1 commit into
webrpc:masterfrom
klaidliadon:feat/python-parity

Conversation

@klaidliadon

Copy link
Copy Markdown
Contributor

Two parity follow-ups for the Python generator (now that it's released at v0.1.0):

  1. -webrpcHeader=false opt-out — every other generator gates the Webrpc version header on $opts.webrpcHeader, but gen-python hardcoded it always-on. Added the flag (default on), gating the client request header. Consts and server responses are unchanged, matching gen-typescript's semantics.
  2. Exercise the Quantity alias — it was defined in the example schema but never referenced, so only ItemName was actually covered. Added a quantity: Quantity field to Item so the alias round-trips through serde (wire shape + decode), with assertions in the test.

Also documents -webrpcHeader in the README options table.


Verified locally:

  • make generate → clean diff (golden reproduces; only the new field + schema hash changed)
  • make testROUNDTRIP OK
  • generating with -webrpcHeader=false omits the Webrpc client header and the output parses as valid Python

Targets v0.1.1.

- add `-webrpcHeader=false` to omit the `Webrpc` version header from
  client requests (parity with the other generators; consts and server
  responses unchanged, matching gen-typescript semantics)
- use the `Quantity` alias as an `Item` field so alias serde is exercised
  end-to-end (wire shape + roundtrip), not merely defined
- document `-webrpcHeader` in the README options table

Verified: `make generate` clean diff (only the new field + hash), `make
test` passes, and `-webrpcHeader=false` output omits the client header
and parses as valid Python.
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