Skip to content

Commit

Permalink
fix(schema): Fix TypeBox extension value query syntax inference (#3010)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl authored Jan 26, 2023
1 parent e4a9da5 commit f1c7a76
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions packages/typebox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,21 @@ export const queryProperty = <T extends TSchema, X extends { [key: string]: TSch
Type.Union([
def,
Type.Partial(
Type.Object({
$gt: def,
$gte: def,
$lt: def,
$lte: def,
$ne: def,
$in: Type.Array(def),
$nin: Type.Array(def),
...extension
}),
{ additionalProperties: false }
Type.Intersect(
[
Type.Object({
$gt: def,
$gte: def,
$lt: def,
$lte: def,
$ne: def,
$in: Type.Array(def),
$nin: Type.Array(def)
}),
Type.Object(extension)
],
{ additionalProperties: false }
)
)
])
)
Expand Down

0 comments on commit f1c7a76

Please # to comment.