conjure-java
conjure-java copied to clipboard
read safety of external types
This PR follows up https://github.com/palantir/conjure/pull/1315 to support log safety annotations for external imports, declared at import time.
Generate changelog in changelog/@unreleased
changelog/@unreleasedType
- [x] Feature
- [ ] Improvement
- [ ] Fix
- [ ] Break
- [ ] Deprecation
- [ ] Manual task
- [ ] Migration
Description
Check the box to generate changelog(s)
- [x] Generate changelog entry
Could you update example-types.yml to take advantage of this, and regenerate the integrationInput sources using ./gradlew test -Drecreate=true?
Separately (potentially as a separate PR from this one as it may become a little more involved):
I think as written, this will update generated types which contain external imports to reflect the safety of those types, however we probably also want to annotate some of the getter and setter fields with safety annotations since the imported type itself isn't annotated (java.lang.Long doesn't have a safe or unsafe annotation). This way, if we alias a safe external long import, the alias factory method becomes public static MyAlias of(@Safe long value), so that unsafe data cannot be passed in.
That sounds like a plan - I'll open a separate PR for that change.