@omnigraph/json-schema 0.112.1 → 0.112.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -388,8 +388,13 @@ function getComposerFromJSONSchema({ subgraphName, schema, logger, getScalarForF
388
388
  // Remaining object/$ref members are left as a 1-element union so `leave` can reuse that type
389
389
  // instead of cloning it as `Title2`. Keep this after `pattern` so pattern-only nullable
390
390
  // wrappers do not mint a second regexp scalar (Slack Bot_User_ID / #9637 CI).
391
+ //
392
+ // Exception: status-code response unions encode HTTP 204 (no body) as `{ type: 'null' }`.
393
+ // Those arms are success outcomes (Void), not nullability markers — skip the strip (#9641).
394
+ const isStatusCodeResponseUnion = subSchema.$comment?.startsWith('statusCodeOneOfIndexMap:');
391
395
  for (const unionKey of ['anyOf', 'oneOf']) {
392
- if (subSchema[unionKey] &&
396
+ if (!isStatusCodeResponseUnion &&
397
+ subSchema[unionKey] &&
393
398
  !subSchema.properties &&
394
399
  !subSchema.allOf &&
395
400
  !subSchema.additionalProperties) {
@@ -385,8 +385,13 @@ export function getComposerFromJSONSchema({ subgraphName, schema, logger, getSca
385
385
  // Remaining object/$ref members are left as a 1-element union so `leave` can reuse that type
386
386
  // instead of cloning it as `Title2`. Keep this after `pattern` so pattern-only nullable
387
387
  // wrappers do not mint a second regexp scalar (Slack Bot_User_ID / #9637 CI).
388
+ //
389
+ // Exception: status-code response unions encode HTTP 204 (no body) as `{ type: 'null' }`.
390
+ // Those arms are success outcomes (Void), not nullability markers — skip the strip (#9641).
391
+ const isStatusCodeResponseUnion = subSchema.$comment?.startsWith('statusCodeOneOfIndexMap:');
388
392
  for (const unionKey of ['anyOf', 'oneOf']) {
389
- if (subSchema[unionKey] &&
393
+ if (!isStatusCodeResponseUnion &&
394
+ subSchema[unionKey] &&
390
395
  !subSchema.properties &&
391
396
  !subSchema.allOf &&
392
397
  !subSchema.additionalProperties) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigraph/json-schema",
3
- "version": "0.112.1",
3
+ "version": "0.112.2",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"