fix: support empty schemas for Type.Any() and Type.Unknown()#11
Merged
fix: support empty schemas for Type.Any() and Type.Unknown()#11
Conversation
Empty schemas are valid in OpenAPI 3.1 (JSON Schema 2020-12) and mean
"any value". TypeBox 1.x's Type.Any() and Type.Unknown() both produce
{}, which was incorrectly rejected by findTaggedSchemasInSchemas.
- Remove ESLint, Prettier, Husky, and lint-staged - Add Biome for linting and formatting - Add Lefthook for git hooks (pre-commit and pre-push) - Hooks run typecheck, lint, and full test suite on both commit and push - Auto-fix formatting and import organization across codebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{}(valid in OAS 3.1 / JSON Schema 2020-12)Type.Any()andType.Unknown()both produce{}, which was incorrectly rejectedChanges
Bug fix:
src/spec-transforms/find.ts: Changed the strict type check to allow empty schemas, returning early instead of throwingTooling:
Test plan
Type.Any()andType.Unknown()inspec-transforms.spec.ts