From af91f7d768d2288adf901fc268732b0d2af670da Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Fri, 21 Aug 2026 14:32:08 +0900 Subject: [PATCH] fix: accept a Question working copy with no resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating a Question was the one document kind that failed: the request carried `resolution: null`, exactly as the contract describes, and validation rejected it with "must not be null". The generated model is where the two disagree. The contract writes the field's nullability as `oneOf: [$ref, {type: "null"}]`, which this generator does not read as nullable, so it saw only the `required` list and emitted @NotNull. `questionStatus` sits in the same required list and worked, because it spells its nullability `type: [string, "null"]`. The contract now leaves `resolution` out of the input's required list, and the regenerated getter is @Nullable. Case, Reference and Decision were never affected — none of them has a nullable $ref in a required list, which is why only Question broke. --- src/config/openapi/studio-v1.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config/openapi/studio-v1.yaml b/src/config/openapi/studio-v1.yaml index 836aa00..f630344 100644 --- a/src/config/openapi/studio-v1.yaml +++ b/src/config/openapi/studio-v1.yaml @@ -959,7 +959,12 @@ components: allOf: - { $ref: "#/components/schemas/WorkingCopyInputBase" } - type: object - required: [kind, questionStatus, facts, assumptions, unknowns, constraints, options, nextValidation, resolution] + # `resolution` 은 여기 없다. 미해결 질문에는 해결 내용이 없고, 그것을 required 로 두면 + # Java 생성기가 nullable 여부와 무관하게 @NotNull 을 찍는다 — oneOf 로 적은 null 을 그 + # 생성기는 읽지 못한다. 실제로 그래서 Question 작업본을 만들 수 없었다: 프론트가 계약대로 + # resolution: null 을 보냈고 백엔드가 422 로 거절했다. 같은 목록의 `questionStatus` 가 + # 통과하는 것은 그쪽이 nullability 를 `type: [string, "null"]` 로 적었기 때문이다. + required: [kind, questionStatus, facts, assumptions, unknowns, constraints, options, nextValidation] properties: kind: { type: string, enum: [QUESTION] } questionStatus: