docs(documents): note nullable minDate/maxDate on DocumentDensityResult (#385)
The empty-result case returns null for both bounds, which the TS codegen surfaces as optional. Future contributors should not "fix" the missing @Schema(REQUIRED) — it is deliberate. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,15 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Result of the timeline density aggregation.
|
||||||
|
*
|
||||||
|
* <p>{@code minDate} / {@code maxDate} are intentionally not marked
|
||||||
|
* {@code @Schema(requiredMode = REQUIRED)} — the empty-result case (no
|
||||||
|
* documents match the filter) returns them as {@code null}, which surfaces in
|
||||||
|
* the generated TypeScript as {@code minDate?: string | null}. Frontend code
|
||||||
|
* must treat them as optional.
|
||||||
|
*/
|
||||||
public record DocumentDensityResult(
|
public record DocumentDensityResult(
|
||||||
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
List<MonthBucket> buckets,
|
List<MonthBucket> buckets,
|
||||||
|
|||||||
Reference in New Issue
Block a user