We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82d0a5a commit d44f34aCopy full SHA for d44f34a
frontend/packages/pydantic-forms/src/core/helper.ts
@@ -204,6 +204,13 @@ export const getFlatFieldMap = (
204
return fieldMap;
205
};
206
207
+/**
208
+ * Checks if the schema's type or one of the combinator props anyOf or oneOf contains a type of 'null'.
209
+ * This tells us if the field is allowed to be null or not.
210
+ *
211
+ * @param schema A field from the 'properties' key of the JSON Schema
212
+ * @returns true if the schema is nullable, false otherwise
213
+ */
214
export const isNullable = (schema: PydanticFormPropertySchemaParsed) => {
215
// Check if the schema has a type of 'null' or if it has an anyOf with a type of 'null'
216
const isNullType = schema.type === PydanticFormFieldType.NULL;
0 commit comments