Skip to content

Commit

Permalink
Fix "Schema Key" becoming an entry in the meditor
Browse files Browse the repository at this point in the history
Pydantic 2.0's JSON schema export no longer specifies a `type` field for
the `schemaKey` property, and leaves it undefined instead. This change
makes it so an undefined type also delegates it as a "basic schema",
meaning it will not be rendered as its own tab in the meditor.
  • Loading branch information
mvandenburgh authored and yarikoptic committed Feb 10, 2024
1 parent 7e9609b commit 8413451
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/components/Meditor/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const isJSONSchema = (schema: JSONSchemaUnionType): schema is JSONSchema7

export const isBasicSchema = (schema: JSONSchemaUnionType): schema is BasicSchema => (
isJSONSchema(schema)
&& isBasicType(schema.type)
&& (isBasicType(schema.type) || schema.type === undefined)
);

export const isObjectSchema = (schema: JSONSchemaUnionType): schema is ObjectSchema => (
Expand Down

0 comments on commit 8413451

Please sign in to comment.