Skip to content

fix(netbox): use numeric exclusiveMinimum/exclusiveMaximum - #42

Merged
jennlu330 merged 2 commits into
itential:mainfrom
jennlu330:fix/netbox-ajv-exclusive-min-max
Jul 23, 2026
Merged

fix(netbox): use numeric exclusiveMinimum/exclusiveMaximum#42
jennlu330 merged 2 commits into
itential:mainfrom
jennlu330:fix/netbox-ajv-exclusive-min-max

Conversation

@jennlu330

Copy link
Copy Markdown
Collaborator

Summary

  • netbox-latest.json used the OpenAPI 3.0 boolean-flag style for range bounds (minimum/maximum paired with exclusiveMinimum: true/exclusiveMaximum: true) on several properties (rf_channel_frequency, rf_channel_width, weight, length, distance, allocated_vcpus, validation_minimum, validation_maximum, etc.)
  • ajv rejects this, expecting exclusiveMinimum/exclusiveMaximum to be numeric — this was throwing 21 schema validation errors (plus cascading $ref/oneOf failures once ajv fell through to alternate schema branches)
  • Converted all 34 exclusiveMinimum and 47 exclusiveMaximum boolean occurrences to the numeric form and dropped the now-redundant minimum/maximum keys

Test plan

  • Verified the resulting file is valid JSON
  • Confirmed no boolean exclusiveMinimum/exclusiveMaximum remain (grep -c '"exclusiveMinimum": true' / "exclusiveMaximum": true" → 0)
  • Diff scoped only to the four affected keys across the 21 impacted schemas — no other content changed

…latest.json

Several schemas (rf_channel_frequency, weight, length, distance, etc.) used
the OpenAPI 3.0 boolean-flag style (minimum/maximum + exclusiveMinimum:
true), which ajv rejects when validating exclusiveMinimum/exclusiveMaximum
as numbers. Convert to the numeric form and drop the redundant
minimum/maximum keys, resolving all associated $ref/oneOf cascade errors.
@jennlu330
jennlu330 requested a review from michaelelrom July 22, 2026 15:55
….json

The platform's ajv validator turns out to be asymmetric: it requires
exclusiveMinimum as a number but exclusiveMaximum as a boolean paired
with a separate maximum. The prior commit converted both to numeric,
which fixed exclusiveMinimum but broke exclusiveMaximum. Revert
exclusiveMaximum back to boolean + maximum while keeping
exclusiveMinimum numeric.
@jennlu330

jennlu330 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Update: the platform's ajv validator turned out to be asymmetric — it requires exclusiveMinimum as a number but exclusiveMaximum as a boolean (paired with a separate maximum), rather than treating both the same way. Pushed a follow-up commit that keeps exclusiveMinimum numeric and reverts exclusiveMaximum back to the boolean + maximum form, matching the shape observed in the second round of ajv errors. Awaiting re-import confirmation.

@jennlu330
jennlu330 merged commit 593fb21 into itential:main Jul 23, 2026
@jennlu330
jennlu330 deleted the fix/netbox-ajv-exclusive-min-max branch July 23, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant