Commit 535a8ef
authored
Remove duplicate
## Summary
`catalog.SseEncryptionDetailsAlgorithm` published a duplicated `enum` in
the generated bundle JSON schema:
```json
"enum": ["AWS_SSE_S3", "AWS_SSE_KMS", "AWS_SSE_KMS", "AWS_SSE_S3"]
```
JSON Schema requires enum values to be unique, so strict validators
(e.g. OPA) reject the entire schema at compile time. The duplicate has
shipped since v0.290.0 (Feb 26 2026); the issue reports it "since
v0.299.1" only because that is the first release where `jsonschema.json`
was published as a downloadable release asset, so it is the earliest
version an external consumer could inspect.
Fixes databricks#5713.
## Root cause
The enum was **hand-authored** for
`catalog.SseEncryptionDetailsAlgorithm` in databricks#4484 (UC external locations,
Feb 18 2026), in the hand-authored override annotation file, with order
`[AWS_SSE_KMS, AWS_SSE_S3]`. At that point the SDK-derived annotations
did not define this type, so the generated schema had the correct **2**
entries.
Two days later, databricks#4552 (Upgrade Go SDK to v0.110.0, Feb 20 2026)
regenerated the SDK-derived annotation file, which now defined the same
enum with order `[AWS_SSE_S3, AWS_SSE_KMS]`. From then on **both**
annotation sources supplied the enum. The annotation merge concatenates
sequences, so the two pairs combined into four entries — `[S3, KMS]`
(SDK, merge base) followed by `[KMS, S3]` (override), producing `[S3,
KMS, KMS, S3]`.
The later consolidation of the annotation files into a single
`annotations.yml` + `.codegen/cli.json` (databricks#5484 / databricks#5574) preserved this
pre-existing duplicate rather than causing it; only the file names
changed. `annotations.yml` is **not** generated from `cli.json` —
`./task generate-schema` only syncs descriptions and placeholders and
drops stale entries; it never rewrites hand-authored enums. So the
redundant entry persisted silently across the refactor.
## Fix
- Remove the redundant hand-authored `enum` from `annotations.yml`,
leaving `cli.json` (SDK-derived) as the single source of truth. The
`description` override there is intentional (it differs from cli.json's
text) and is kept.
- Regenerate `bundle/schema/jsonschema.json`; the enum is now
`["AWS_SSE_S3", "AWS_SSE_KMS"]`.
- Add `TestJsonSchemaEnumsAreUnique`, a whole-schema guard that walks
every `enum` in the embedded schema and fails on any duplicate, so this
class of bug cannot return regardless of source.
## Tests
- `go test ./bundle/internal/schema ./bundle/schema -count=1`
- Verified the new guard fails on the pre-fix schema, reporting the
exact path `$defs/.../catalog.SseEncryptionDetailsAlgorithm/oneOf[0]`.
- Confirmed the regenerated schema is reproducible via the schema
generator.
This pull request and its description were written by Isaac, an AI
coding agent.enum values for jsonschema.json (databricks#5839)1 parent 353cb5a commit 535a8ef
4 files changed
Lines changed: 44 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | 850 | | |
856 | 851 | | |
857 | 852 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments