Skip to content

Commit

Permalink
fix: add explicit type information to object intersection
Browse files Browse the repository at this point in the history
Strict mode requires type set to object for unevaluatedProperties.
  • Loading branch information
elyukai committed Dec 7, 2023
1 parent d6213d4 commit 69e7afe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderers/jsonSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ interface Union extends Annotated {
oneOf: Definition[]
}

interface Intersection extends Annotated {
interface Intersection {
type?: "object"
allOf: Definition[]
unevaluatedProperties?: boolean
}
Expand Down Expand Up @@ -347,6 +348,7 @@ const nodeToDefinition = (
)
return {
...base,
type: "object",
unevaluatedProperties: allowAdditionalProperties,
}
} else {
Expand Down

0 comments on commit 69e7afe

Please sign in to comment.