oxidecomputer / oxidecomputer/progenitor

Panic during code generation when using builder style interface + object in query parameters

Open
#1,221 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1k
Forks
136
Avg merge
8h 36m
Merged PRs (30d)
14

Description

Sorry for not putting together something to reproduce the issue:

I'm using the builder-style interface; an OpenAPI spec that I don't control has been updated to specify its query parameters as an object.

I'm hitting a panic here: https://github.com/oxidecomputer/progenitor/blob/9d88d24c6931887579e490d596d2e8b85e3f552a/progenitor-impl/src/method.rs#L1576-L1588

Message:  assertion `left == right` failed
  left: "my_object"
 right: "body"

I've tried patching the code generation locally to parameterize the codegen in this branch + remove the assertion - but I haven't had the time to understand the surrounding code yet (and if there's a reason for the assertion beyond "we don't expect any builders that aren't for the body").

Is this just a case of not having implemented https://github.com/oxidecomputer/progenitor/pull/1017 at the time the assertion was written?

The fix appears to be relatively straightforward but I'm struggling to get the time to think it through/follow it through - I just wanted to make sure that I wasn't missing something obvious.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at progenitor-impl/src/method.rs lines 1576-1588 and inspect the surrounding builder-style code generation. Compare the assertion with the changes discussed in pull request #1017, then verify that an object used in query parameters no longer causes a panic during generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, rust
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.