coreapi: refresh spec — tolerate unknown response fields#1375
Open
stiak wants to merge 1 commit into
Open
Conversation
Upstream flipped all 54 schemas from `additionalProperties: false` to `true`. Regenerating turns the generated decoders from strict (hard-error `unexpected field %q`) into tolerant (unknown fields captured into an AdditionalProps map), so a new field on any core API model no longer breaks the CLI. Refreshed via `curl ... openapi.json` + `go generate ./internal/coreapi/...`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 756af473d089
Contributor
There was a problem hiding this comment.
Pull request overview
Refreshes the vendored Core API OpenAPI spec and regenerates the ogen-based client/models to tolerate unknown JSON object fields (forward compatibility), by switching schemas to additionalProperties: true and capturing unknown keys into AdditionalProps maps.
Changes:
- Updated the upstream Core API OpenAPI spec JSON and normalized generated spec.
- Regenerated Core API Go schemas to include
AdditionalPropson object models. - Regenerated JSON encoders/decoders to preserve unknown fields instead of failing on them.
Reviewed changes
Copilot reviewed 1 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/coreapi/spec/core.openapi.json | Refreshed upstream OpenAPI document with additionalProperties: true across schemas. |
| internal/coreapi/spec/core.gen.json | Updated normalized/generated spec to match upstream schema permissiveness. |
| internal/coreapi/oas_schemas_gen.go | Regenerated Go model structs to include per-type AdditionalProps maps. |
| internal/coreapi/oas_json_gen.go | Regenerated JSON codecs to accept unknown fields and round-trip them via AdditionalProps. |
Files not reviewed (1)
- internal/coreapi/oas_schemas_gen.go: Language not supported
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.
https://entire.io/gh/entireio/cli/trails/525
Upstream flipped all 54 schemas from
additionalProperties: falsetotrue. Regenerating turns the generated decoders from strict (hard-errorunexpected field %q) into tolerant (unknown fields captured into an AdditionalProps map), so a new field on any core API model no longer breaks the CLI.Refreshed via
curl ... openapi.json+go generate ./internal/coreapi/....Entire-Checkpoint: 756af473d089
Note
Medium Risk
Touches all generated core API models and decoders, but the change is mechanical and intentionally loosens parsing to improve forward compatibility rather than altering auth or business logic.
Overview
Refreshes the core API OpenAPI spec (
internal/coreapi/spec/core.gen.json) from upstream and regenerates the ogen client (oas_*_gen.go).Upstream set
additionalProperties: trueon object schemas (previouslyfalseacross the board). Generated JSON decoders no longer fail withunexpected fieldon unknown keys; extra properties are stored in per-typeAdditionalPropsmaps and round-tripped on encode. The CLI can keep working when the control plane adds fields to responses before this repo picks up typed fields.Regeneration is via
go generate ./internal/coreapi/...after fetching the latestopenapi.json.Reviewed by Cursor Bugbot for commit 179a6cd. Configure here.