fief-dev / fief

Users and authentication management SaaS
https://www.fief.dev
Other
488 stars 42 forks source link

UserFieldConfiguration doesn't comply with the schema when created from dashboard #166

Closed frankie567 closed 1 year ago

frankie567 commented 1 year ago

When we create a UserField from admin dashboard, the configuration field may not follow the schema of UserFieldConfiguration.

Typically, when creating a date field, the form doesn't show the default field. Therefore, it's not included in the serialization when saved to DB. This has caused bugs like #165.

When creating from the API, it doesn't happen because the Pydantic schema make sure to add the field with None value.

We should improve this so the configuration field conforms to the schema even when created/updated from the dashboard.