fix: accept a Question working copy with no resolution
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.
This commit is contained in:
@@ -959,7 +959,12 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
- { $ref: "#/components/schemas/WorkingCopyInputBase" }
|
- { $ref: "#/components/schemas/WorkingCopyInputBase" }
|
||||||
- type: object
|
- 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:
|
properties:
|
||||||
kind: { type: string, enum: [QUESTION] }
|
kind: { type: string, enum: [QUESTION] }
|
||||||
questionStatus:
|
questionStatus:
|
||||||
|
|||||||
Reference in New Issue
Block a user