Commits
Tarun Sukhani authored 3f4638fa65d
feat: OpenApiGenerator getters + records + stdlib value types (PF-98, PF-99, PF-100, release 1.13.15)
PF-98 — after the PF-97 public-field pass, enumerate public no-arg getter
methods on classes and interfaces (getX/isX), deriving property names via
java.beans.Introspector.decapitalize so getURL() maps to URL. Excludes
Object-inherited methods (getClass). Deduplicates against fields by final
property name; fields win. This fixes interfaces like play.data.Upload
that have no fields but expose data via getters.
PF-99 — short-circuit Class.isRecord() to enumerate getRecordComponents()
instead of running the field/getter passes. Annotations may live on the
canonical constructor parameter or on the accessor method; both are
consulted via a unified addProperty(primary, secondary) helper that also
serves the field and getter call sites.
PF-100 — three additions to schemaFor/classSchema:
- Stdlib value types (UUID, URI, URL, Date, Instant, LocalDate, etc.,
BigDecimal/BigInteger, Duration) map to typed-string / typed-number
schemas with the right OpenAPI format strings. Without this, every
timestamp/uuid field rendered as an empty {type: object}.
- Optional<T> unwraps to schemaFor(T) with nullable: true sibling.
OpenAPI-3.1-clean; 3.0 consumers tolerate the sibling on $ref.
- Map<K, V> preserves V through additionalProperties. K is intentionally
ignored (OpenAPI 3 treats map keys as strings by default).
Each ticket includes graceful-degradation paths: raw Optional / raw Map /
unrecognized stdlib types fall through to the existing ObjectSchema()
behavior with no regression. Annotation detection remains by simple-name
so Jackson/Gson stay off the framework's compile-time classpath.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>