Mark upload request bodies required from policy #6
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/requestbody-required-overrides"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
swift-openapi-generator does not emit an optional multipart request body at all. It warns ("Multipart request bodies must always be required, but found an optional one - skipping") and generates the operation with no body parameter, so an upload endpoint ends up present in the client and impossible to call.
Upstream leaves
repoCreateReleaseAttachment's body unmarked, which is why Fjord has no way to attach a file to a release today. Rather than hand-editing the vendored spec, this adds a second policy-driven patch pass next to the existingrequiredOverridesone:requestBodyOverridesnames the operations whose request body has to be marked required, andmake patchruns the two passes in sequence.The new script validates each entry against the spec, so an operation that is missing or has no request body fails at patch time instead of quietly patching nothing.
make check-patchedis green and the pass is idempotent.swift-openapi-generator does not emit an optional multipart request body at all. It warns ("Multipart request bodies must always be required, but found an optional one - skipping") and generates the operation with no body parameter, which leaves an upload endpoint present in the client and impossible to call. Upstream leaves repoCreateReleaseAttachment's body unmarked, so the Swift client had no way to attach a file to a release. Rather than hand-editing the vendored spec, this adds a second policy-driven patch pass alongside the existing requiredOverrides one: requestBodyOverrides names the operations whose request body has to be marked required, and the patch target runs both passes in sequence. The script fails when an entry names an operation that is missing or has no request body, so a stale entry surfaces at patch time rather than silently patching nothing.