Skip to content

coreapi: refresh spec — tolerate unknown response fields#1375

Open
stiak wants to merge 1 commit into
mainfrom
update-api-specs
Open

coreapi: refresh spec — tolerate unknown response fields#1375
stiak wants to merge 1 commit into
mainfrom
update-api-specs

Conversation

@stiak
Copy link
Copy Markdown
Contributor

@stiak stiak commented Jun 5, 2026

https://entire.io/gh/entireio/cli/trails/525

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/....

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: true on object schemas (previously false across the board). Generated JSON decoders no longer fail with unexpected field on unknown keys; extra properties are stored in per-type AdditionalProps maps 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 latest openapi.json.

Reviewed by Cursor Bugbot for commit 179a6cd. Configure here.

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
Copilot AI review requested due to automatic review settings June 5, 2026 01:00
@stiak stiak requested a review from a team as a code owner June 5, 2026 01:00
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

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 AdditionalProps on 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

Comment thread internal/coreapi/oas_json_gen.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants