You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`pick`| Include only these fields |`pick = ["name", "email"]`|
324
337
|`omit`| Exclude these fields |`omit = ["password"]`|
338
+
|`omit_default`| Auto-omit fields with DB defaults |`omit_default` (bare keyword) |
325
339
326
340
**Situational (Use When Needed):**
327
341
@@ -379,6 +393,10 @@ vespera::schema_type!(Schema from Model, name = "MemoSchema");
379
393
380
394
**Circular Reference Handling:** Automatically detected and handled by inlining fields.
381
395
396
+
**Database Defaults in OpenAPI:** Fields with `#[sea_orm(default_value = "...")]` or `#[sea_orm(primary_key)]` automatically get `default` values in the generated OpenAPI schema. SQL functions like `NOW()` and `gen_random_uuid()` are mapped to type-appropriate defaults.
397
+
398
+
**Required Logic:**`required` is determined **solely by nullability** (`Option<T>`). Fields with `#[serde(default)]` or `#[serde(skip_serializing_if)]` are still `required` unless they are `Option<T>`.
0 commit comments