From f4f7dace6c58b23f102d11aaa8a59fab5cb16311 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 10:15:50 +0000 Subject: [PATCH 1/3] Correct the Story custom field and Outcome Indicator schemas (CP-9078) Stories return id, name, type and value for each custom field; the restricted flag from CP-9145 applies only to Contacts' fields, so Story gets its own StoryCustomFieldValue schema. GET /outcome_indicators also returns framework_indicator_id, added by CP-9081. Both found by the Rails repo's contract specs when its copy of this spec was refreshed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xrPqUbvvVon46Peko4 --- openapi.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 00615bf..5f12529 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -26696,6 +26696,24 @@ components: description: True when Field Visibility hides this field from you; `value` is then null, whether or not it has an answer example: true + StoryCustomFieldValue: + type: object + description: An answer to one of the Story's own custom fields. Field Visibility applies to Contacts' fields, not these, so there is no `restricted` flag. + properties: + id: + type: integer + example: 88 + name: + type: string + example: "Session location" + type: + type: string + example: "text" + description: "Field type: text, date, time, file, etc." + value: + description: Field value (string for most types; object for file attachments) + example: "Community centre" + Story: allOf: - $ref: '#/components/schemas/Timestamps' @@ -26749,7 +26767,7 @@ components: custom_fields: type: array items: - $ref: '#/components/schemas/CustomFieldValue' + $ref: '#/components/schemas/StoryCustomFieldValue' verdict_scores: type: array items: @@ -27412,6 +27430,11 @@ components: indicator_id: type: integer example: 577 + framework_indicator_id: + type: integer + nullable: true + example: null + description: For an Indicator linked to an Outcome in a Framework Set, which of the Outcome's own core Indicators it counts as (for example a TOMs Measure). Null when it counts as the Outcome itself, or isn't a linked Indicator. RatioSet: allOf: From 80c607119c1a82655e507c5b3a57f7d400b357b0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 10:49:17 +0000 Subject: [PATCH 2/3] Document the shorter Contact and Project list items GET /beneficiaries leaves out weekly_availability and GET /projects leaves out the seven Project detail fields, so give the lists their own item shapes (ProjectListItem, Beneficiary) and the single-record responses the fuller ones (Project, BeneficiaryDetail). Make ContactWeeklyAvailability itself nullable: nullable beside allOf doesn't let null through. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xrPqUbvvVon46Peko4 --- openapi.yaml | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 5f12529..efcfa2d 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4598,7 +4598,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Beneficiary' + $ref: '#/components/schemas/BeneficiaryDetail' "401": $ref: '#/components/responses/Unauthorized' "422": @@ -4619,7 +4619,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Beneficiary' + $ref: '#/components/schemas/BeneficiaryDetail' "401": $ref: '#/components/responses/Unauthorized' "404": @@ -26127,7 +26127,8 @@ components: type: integer minimum: 0 - Project: + ProjectListItem: + description: A Project as returned by `GET /projects`. `GET /projects/{id}`, `POST /projects` and `PATCH /projects/{id}` return the fuller Project. allOf: - $ref: '#/components/schemas/Timestamps' - type: object @@ -26141,6 +26142,20 @@ components: charity_id: type: integer example: 31 + is_closed: + type: boolean + example: false + beneficiary_category_ids: + type: array + items: + type: integer + description: The Contact Forms used to create Contacts in the Project. + + Project: + allOf: + - $ref: '#/components/schemas/ProjectListItem' + - type: object + properties: default_results_template_id: type: integer nullable: true @@ -26172,14 +26187,6 @@ components: project_category_id: type: integer example: 88 - is_closed: - type: boolean - example: false - beneficiary_category_ids: - type: array - items: - type: integer - description: The Contact Forms used to create Contacts in the Project. ProjectSaveRequest: type: object @@ -26384,17 +26391,22 @@ components: type: array description: What the Contact needs a specialist in, each Essential or Desirable, added by hand or from a form answer items: { $ref: '#/components/schemas/RequiredSkill' } + + BeneficiaryDetail: + description: A Contact (Beneficiary) as returned by `GET /beneficiaries/{id}` and `POST /beneficiaries`. The list endpoint leaves out `weekly_availability`. + allOf: + - $ref: '#/components/schemas/Beneficiary' + - type: object + properties: weekly_availability: - allOf: - - $ref: '#/components/schemas/ContactWeeklyAvailability' - nullable: true - description: The Contact's Weekly availability, or null if they haven't answered a Weekly availability field + $ref: '#/components/schemas/ContactWeeklyAvailability' ContactWeeklyAvailability: type: object + nullable: true description: >- - The most recently saved answer to any Weekly availability field on the Contact's Contact Forms. Use it to - suggest appointment times the Contact can attend. + The most recently saved answer to any Weekly availability field on the Contact's Contact Forms, or null if + they haven't answered one. Use it to suggest appointment times the Contact can attend. properties: times: type: array @@ -27506,7 +27518,7 @@ components: data: type: array items: - $ref: '#/components/schemas/Project' + $ref: '#/components/schemas/ProjectListItem' PaginatedUsers: allOf: From 7ad7aeae6299f89b0f85a8ee2be88ad2f34c3615 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:20:55 +0000 Subject: [PATCH 3/3] Document Event Format validation errors as a list POST and PATCH /event_categories return errors as an array of messages, which UnprocessableEntityList describes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xrPqUbvvVon46Peko4 --- openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index efcfa2d..14d3701 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -9733,7 +9733,7 @@ paths: "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntity' + $ref: '#/components/responses/UnprocessableEntityList' /event_categories/{id}: get: @@ -9850,7 +9850,7 @@ paths: "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntity' + $ref: '#/components/responses/UnprocessableEntityList' delete: tags: [Event Formats] summary: Delete an Event Format