Skip to content

Commit c36b8a2

Browse files
committed
fix: avoid spectral crash on null example in PATCH settings spec
Spectral 6.16.0 (nimma) crashes with "Cannot read properties of null (reading 'enum')" when a lint rule traverses a literal null leaf in an example value — which the merge-patch `remove` example introduced (target_language: null). Drop the structured null example and show the null-removes form in the operation description instead. SDK codegen still learns nullability from the schema (target_language type: [string, "null"]), so the contract is unchanged. ENG-1254
1 parent 55d6f5a commit c36b8a2

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

openapi.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,8 +1334,9 @@ paths:
13341334
description: |
13351335
Partially updates the enrichment settings for the specified tenant_id using RFC 7396 JSON Merge
13361336
Patch semantics (media type application/merge-patch+json; application/json is also accepted). For
1337-
each member: a value sets that setting, JSON null removes it, and an omitted member is left
1338-
unchanged. The tenant_id is taken from the path, so a request can only ever modify its own
1337+
each member: a value sets that setting, JSON null removes it (e.g. `{"target_language": null}`
1338+
clears the target language), and an omitted member is left unchanged. The tenant_id is taken
1339+
from the path, so a request can only ever modify its own
13391340
tenant's settings. target_language is normalized to a canonical BCP-47 locale (e.g. "en-us"
13401341
becomes "en-US"); an empty string is rejected (send null to remove it). While a tenant data purge
13411342
runs for the same tenant_id, this write is rejected with HTTP 409 (code `tenant_write_conflict`)
@@ -1363,10 +1364,6 @@ paths:
13631364
summary: Set the target language (other settings untouched)
13641365
value:
13651366
target_language: "de-DE"
1366-
remove:
1367-
summary: Remove the target language (RFC 7396 null)
1368-
value:
1369-
target_language: null
13701367
application/json:
13711368
schema:
13721369
$ref: '#/components/schemas/PatchTenantSettingsInputBody'

0 commit comments

Comments
 (0)