| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Warning
This PR extends the internal JSON schema-validation helpers to better distinguish “optional” vs “optional-or-null” fields, and to add first-class validators for number and object. It also updates start-proxy configuration schemas to use the new optionalOrNull semantics and adjusts unit tests accordingly.
Changes:
| File | Description |
|---|---|
| src/start-proxy/types.ts | Switches relevant schema fields from optional to optionalOrNull for backwards-compatible null acceptance. |
| src/json/index.ts | Adds number/object validators and splits optional handling into optionalOrNull vs optional. |
| src/json/index.test.ts | Updates/expands tests to cover the new optional semantics (optionalOrNull vs optional). |
| lib/entry-points.js | Generated output (content excluded from review per policy). |
Sorry, something went wrong.
| /** A validator for number fields in schemas. */ | ||
| export const number = { | ||
| validate: isNumber, | ||
| required: true, | ||
| } as const satisfies Validator<number>; |
These have been spun off into #3980.
The previous implementation of `optional` is now `optionalOrNull`.
By @mbg Co-authored-by: Michael B. Gale <mbg@github.com>
| Back | FazBrowse Home | New Git URL |
Summary
This pull request introduces several additions to the JSON schema-validation utilities:
This PR is a prerequisite for #3950.
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
Products:
Environments:
How did/will you validate this change?
If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist