Skip to content

Update OpenAPI version spec from 3.0.x to 3.1.x - #5819

Merged
MonkeyCanCode merged 1 commit into
apache:mainfrom
MonkeyCanCode:openapi_update
Oct 20, 2026
Merged

MonkeyCanCode merged 1 commit into
apache:mainfrom
MonkeyCanCode:openapi_update

Conversation

@MonkeyCanCode

@MonkeyCanCode MonkeyCanCode commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

This PR updates OpenAPI spec version from 3.0.x to 3.1.x (ref: https://learn.openapis.org/upgrading/v3.0-to-v3.1.html). With this change, this also allow us to use newer version of openapi generator which fix #2392.

There is one blocker before we can merge this RP where the upstream 3.1.x iceberg spec is actually invalid and I had raised apache/iceberg#18428 to fix that. For the time being, I added the fix to spec/iceberg-rest-catalog-open-api.yaml.

Also, there are couple changes introduced between 7.12.0 to 7.26.0 and those are all addressed as well (build and python generated code).

Checklist

  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copilot AI balanced review requested due to automatic review settings October 19, 2026 06:10
@github-project-automation github-project-automation Bot moved this to PRs In Progress in Basic Kanban Board Oct 19, 2026
@MonkeyCanCode MonkeyCanCode changed the title Update OpenAPI spec from 3.0.x to 3.1.x Update OpenAPI version spec from 3.0.x to 3.1.x Oct 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-language generation compatibility needs human verification, and the acknowledged upstream specification blocker remains open.

2 open issues
What changed in this PR

Migrates Polaris specifications to OpenAPI 3.1.1 to support the generator upgrade associated with #2392.

Changes:

  • Updates nullable schemas and OpenAPI Generator to 7.26.0.
  • Uses bundled catalog specifications for generation and checks bundle freshness in CI.
  • Adapts Python CLI code and fixtures to generated model changes.
File Description
spec/​polaris-management-service.yml Declares OpenAPI 3.1.1.
spec/​polaris-catalog-service.yaml Declares OpenAPI 3.1.1.
spec/​polaris-catalog-apis/​policy-apis.yaml Migrates nullable policy schemas.
spec/​iceberg-rest-catalog-open-api.yaml Migrates nullable Iceberg schemas.
spec/​generated/​bundled-polaris-catalog-service.yaml Refreshes the generated bundle.
Makefile Adds bundle freshness verification.
gradle/​libs.versions.toml Upgrades the generator plugin.
extensions/​semantic-models/​build.gradle.kts Uses bundled input and updated generator properties.
client/​python/​uv.lock Locks the upgraded generator.
client/​python/​tests/​test_views_command.py Updates view model fixtures.
client/​python/​tests/​cli_test_utils.py Initializes catalog-base mock configuration.
client/​python/​pyproject.toml Upgrades Python generator dependencies.
client/​python/​generate_clients.py Uses bundled catalog input.
client/​python/​apache_polaris/​cli/​command/​views.py Reads SQL representations directly.
api/​polaris-catalog-service/​build.gradle.kts Uses bundled input and updated properties.
api/​management-service/​build.gradle.kts Updates generator property assignments.
api/​management-model/​build.gradle.kts Updates generator property assignments.
api/​iceberg-service/​build.gradle.kts Uses bundled input and updated properties.
.github/​workflows/​ci.yml Checks bundle freshness.
.github/​renovate.json5 Re-enables Python generator updates.

Review effort: Balanced

type: string
snapshot-id:
type: integer
type: [ integer, "null" ]
POLARIS_MANAGEMENT_SPEC = SPEC_DIR / "polaris-management-service.yml"
ICEBERG_CATALOG_SPEC = SPEC_DIR / "iceberg-rest-catalog-open-api.yaml"
POLARIS_CATALOG_SPEC = SPEC_DIR / "polaris-catalog-service.yaml"
POLARIS_CATALOG_SPEC = SPEC_DIR / "generated" / "bundled-polaris-catalog-service.yaml"
// The OpenAPI generator does NOT resolve relative paths correctly against the Gradle project
// directory
inputSpec = provider { specsDir.file("polaris-catalog-service.yaml").asFile.absolutePath }
inputSpec = specsDir.file("generated/bundled-polaris-catalog-service.yaml")

@dimas-b dimas-b Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the conceptual difference between polaris-catalog-service.yaml and bundled-polaris-catalog-service.yaml? They seem to contain the same sets of endpoints... this is just for my education 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is needed because after updating the spec from 3.0.x to 3.1.x, openapi-generator's parser crashes on the valid references between files (the recursive Predicate overflows the stack). By using the bundle file, it avoids these cross-file references. It also avoids the parser silently dropping paths whose cross-file $ref contains unencoded {/}. Encoding them as %7B/%7D fixes the dropped paths, but the parser then hits the crash above.

From the testing, resolving the reference into another file in 3.1.x produces a Predicate that contains AndOrPredicate, which contains Predicate again. Walking this cycle overflows the stack. I am not able to find existing bug around this but it is reproducible with this spec as I made the change from 3.0.x to 3.1.x.

@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Oct 19, 2026
Comment on lines -2512 to +2514
type: string
nullable: true
type:
- string
- 'null'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like Iceberg spec doesn't make this change, https://github.com/apache/iceberg/blob/6890694bd326648c3ab5930b8c97986118bbc1e5/open-api/rest-catalog-open-api.yaml#L2408 even though it is with openapi 3.1.1.
https://github.com/apache/iceberg/blob/6890694bd326648c3ab5930b8c97986118bbc1e5/open-api/rest-catalog-open-api.yaml#L21. Why was that? Do we need a similar change in Iceberg repo?

It is preferable to keep both doc sync, so that we dont' have to manually maintain the difference every time we pull it from the upstream.

@MonkeyCanCode MonkeyCanCode Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hello @flyrain , that is correct. I raised PR in apache/iceberg#18428. Beside this, there are already some manual move due to redocly. Here is a recent fix: #5753

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the Iceberg PR. Approved!

@MonkeyCanCode

MonkeyCanCode commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Should I proceed with merge this or wait for upstream to get merge first? @flyrain @adutra @dimas-b @jbonofre @vigneshio ?

@dimas-b

dimas-b commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

The change in the Iceberg API spec is purely syntactic. I do not see a reason to wait for upstream on this change.

@flyrain

flyrain commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

+1 on merging as is

@MonkeyCanCode
MonkeyCanCode merged commit 5fafc67 into apache:main Oct 20, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Oct 20, 2026
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.

7 participants