Skip to content

chore: upgrade oapi-codegen to v2.6.0#112

Merged
hanneshayashi merged 2 commits intomainfrom
chore/upgrade-oapi-codegen-v2.6.0
Mar 4, 2026
Merged

chore: upgrade oapi-codegen to v2.6.0#112
hanneshayashi merged 2 commits intomainfrom
chore/upgrade-oapi-codegen-v2.6.0

Conversation

@hanneshayashi
Copy link
Copy Markdown
Collaborator

Summary

Upgrades oapi-codegen/v2 from v2.5.1 to v2.6.0 and regenerates models.

Changes

  • go.mod/go.sum: Bump oapi-codegen/v2 v2.5.1 → v2.6.0
  • models_gen.go: Regenerated with new codegen version. Notable changes:
    • Valid() methods added to all enum types (#2227)
    • Rules field changed from *[]GroupAllocationRule to *[]*GroupAllocationRule due to nullable slice elements support (#2185)
    • omitempty added to optional nullable fields (#2221)
  • allocation.go: Updated write path to construct []*GroupAllocationRule and read path to dereference pointer elements with nil guard

Notes

  • Used targeted go get oapi-codegen/v2@v2.6.0 (without -u) because the transitive deps pulled by -u trigger a broken test dependency in speakeasy-api/openapi-overlay
  • Full v2.6.0 release notes

- 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
Copilot AI review requested due to automatic review settings March 4, 2026 10:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/v2 from v2.5.1 to v2.6.0 (and corresponding go.sum entries).
  • Regenerate internal/provider/models/models_gen.go with v2.6.0 (adds enum Valid() helpers, updates nullable/omitempty behavior, updates param serialization helpers).
  • Update allocation resource write/read paths to use []*GroupAllocationRule and 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.

Comment thread internal/provider/allocation.go
Comment thread internal/provider/allocation.go
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>
@hanneshayashi hanneshayashi force-pushed the chore/upgrade-oapi-codegen-v2.6.0 branch from 7820438 to 8f535ca Compare March 4, 2026 10:43
@hanneshayashi hanneshayashi merged commit 52eeb2d into main Mar 4, 2026
5 checks passed
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.

2 participants