You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d7dec5c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(microprofile): annotate enum getters and optional file form params
Two gaps found in review, both leaving optional properties unannotated
under useJspecify:
1. pojo.mustache wired only the {{^isEnum}} getter branch, so an optional
enum-typed property had a @nullable field but a non-null getter —
nullness analysis would treat it as never null. The three enum getter
branches (scalar, array, map) now route through the same partials.
2. formParams.mustache left the isFile branch untouched, so optional file
uploads rendered as bare File / List<File>. Adding the annotation
partial alone was not enough: nullable_var_annotations only *stashes*
the annotation in jSpecifyNullableLambda, and it is re-emitted by a
paired jSpecifyDatatype call. The isFile branch writes a literal type
rather than {{>nullableDataType}}, so the stashed annotation was
silently dropped; the literal is now wrapped in the lambda.
Both are covered by new assertions in testJspecify_microprofile, which
fail if either fix is reverted.
The third review comment, @nullable on a @PathParam, is not a defect:
the jspecify.yaml fixture declares that path parameter `required: false`
on purpose, and the pre-existing tests for the other libraries assert the
same output.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQa4EUVfxzqe4qi9PDj5RU
Copy file name to clipboardExpand all lines: samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/api/UploadApi.java
Copy file name to clipboardExpand all lines: samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/FileContent.java
0 commit comments