Commit e9c0bf7
committed
Add @JsonInclude(NON_NULL) to all generated event classes and warn on Object fallbacks
The code generator (scripts/codegen/java.ts) had two gaps identified
during report-card grading against the Epic #69 rubric:
1. Silent Object fallbacks: When schemaTypeToJava() fell back to
List<Object> (untyped array) or Map<String, Object> (untyped object
without properties or additionalProperties), it did so silently.
Added console.warn() at both sites so type erasure is visible during
generation, matching the existing warnings for anyOf and unrecognized
schema patterns.
2. Missing @JsonInclude(NON_NULL) on outer event classes: The annotation
was present on inner data records and RPC records but missing from
the SessionEvent sealed base class and all outer event variant
classes (e.g., AssistantMessageEvent, ToolExecutionStartEvent). Added
the import and annotation to generateSessionEventBaseClass() and
generateEventVariantClass().
After regenerating, all 75 session event files and 111 RPC type files
were updated. mvn verify passes with 556 tests, 0 failures, 0 errors.1 parent 75e5dba commit e9c0bf7
File tree
77 files changed
+82
-1
lines changed- scripts/codegen
- src/generated/java/com/github/copilot/sdk/generated
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
77 files changed
+82
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
| |||
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
| 296 | + | |
294 | 297 | | |
295 | 298 | | |
296 | 299 | | |
| |||
304 | 307 | | |
305 | 308 | | |
306 | 309 | | |
| 310 | + | |
307 | 311 | | |
308 | 312 | | |
309 | 313 | | |
| |||
539 | 543 | | |
540 | 544 | | |
541 | 545 | | |
| 546 | + | |
542 | 547 | | |
543 | 548 | | |
544 | 549 | | |
| |||
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments