chore: upgrade oapi-codegen to v2.6.0#112
Merged
hanneshayashi merged 2 commits intomainfrom Mar 4, 2026
Merged
Conversation
- Upgrade oapi-codegen/v2 from v2.5.1 to v2.6.0 - Regenerate models with new codegen version - Fix compilation error in allocation.go: Rules field changed from *[]GroupAllocationRule to *[]*GroupAllocationRule due to nullable slice elements support (oapi-codegen#2185) - New Valid() methods added to all enum types - omitempty tags added to optional nullable fields
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the OpenAPI code generation toolchain (oapi-codegen/v2) and refreshes generated Go API models/clients, plus adapts the allocation provider logic to updated generated types (notably nullable slice element support for allocation rules).
Changes:
- Bump
github.com/oapi-codegen/oapi-codegen/v2fromv2.5.1tov2.6.0(and correspondinggo.sumentries). - Regenerate
internal/provider/models/models_gen.gowithv2.6.0(adds enumValid()helpers, updates nullable/omitempty behavior, updates param serialization helpers). - Update allocation resource write/read paths to use
[]*GroupAllocationRuleand to nil-guard when dereferencing rule pointers.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/provider/models/models_gen.go | Regenerated OpenAPI models/client with oapi-codegen/v2 v2.6.0 (enum Valid(), nullable slice elements, omitempty, runtime param serialization changes). |
| internal/provider/allocation.go | Adapts allocation resource logic to new generated Rules type (*[]*GroupAllocationRule) and adds nil-guard on read. |
| go.mod | Bumps github.com/oapi-codegen/oapi-codegen/v2 to v2.6.0. |
| go.sum | Updates checksums for github.com/oapi-codegen/oapi-codegen/v2 v2.6.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use append-based filtering to skip nil elements from the *[]*GroupAllocationRule slice rather than inserting null values. Null elements in Terraform list blocks cause 'Provider produced inconsistent result' errors. A separate ruleIndex counter keeps positional action lookup correct when elements are skipped. Co-authored-by: Copilot <copilot@github.com>
7820438 to
8f535ca
Compare
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.
Summary
Upgrades
oapi-codegen/v2from v2.5.1 to v2.6.0 and regenerates models.Changes
oapi-codegen/v2v2.5.1 → v2.6.0Valid()methods added to all enum types (#2227)Rulesfield changed from*[]GroupAllocationRuleto*[]*GroupAllocationRuledue to nullable slice elements support (#2185)omitemptyadded to optional nullable fields (#2221)[]*GroupAllocationRuleand read path to dereference pointer elements with nil guardNotes
go get oapi-codegen/v2@v2.6.0(without-u) because the transitive deps pulled by-utrigger a broken test dependency inspeakeasy-api/openapi-overlay