Repository navigation
Update OpenAPI version spec from 3.0.x to 3.1.x - #5819
Conversation
There was a problem hiding this comment.
🔵 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") |
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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.
| type: string | ||
| nullable: true | ||
| type: | ||
| - string | ||
| - 'null' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Thanks for the Iceberg PR. Approved!
|
Should I proceed with merge this or wait for upstream to get merge first? @flyrain @adutra @dimas-b @jbonofre @vigneshio ? |
|
The change in the Iceberg API spec is purely syntactic. I do not see a reason to wait for upstream on this change. |
|
+1 on merging as is |


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
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)