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
error[E0277]: the trait bound `domain::entities::prelude::User: Serialize` is not satisfied
--> shared/src/response_models.rs:5:10
|
5 | #[derive(Serialize)]
| ^^^^^^^^^ the trait `Serialize` is not implemented for `domain::entities::prelude::User`
...
10 | User(User),
| ---- required by a bound introduced by this call
|
= note: for local types consider adding `#[derive(serde::Serialize)]` to your `domain::entities::prelude::User` type
= note: for types from other crates check whether the crate offers a `serde` feature flag
= help: the following other types implement trait `Serialize`:
&'a T
&'a UncasedStr
&'a mut T
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and 238 others
note: required by a bound in `serialize_newtype_variant`
--> .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.215/src/ser/mod.rs:943:21
|
935 | fn serialize_newtype_variant<T>(
| ------------------------- required by a bound in this associated function
...
943 | T: ?Sized + Serialize;
| ^^^^^^^^^ required by this bound in `Serializer::serialize_newtype_variant`
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
I genuinely think it has something to do with the DeriveEntityModel trait, and how exactly it converts Model to Entity under the hood.
I genuinely hope this is coherent enough. I've had to type this 3 times already cos I keep accidentally leaving this page, and I'm sleep deprived atp.
Steps to Reproduce
Use the cli to generate entities from migration files in one lib.
create a different lib, and attempt to use ```Serialize trait``` on an enum containing the entity exported by prelude.rs. it should throw same error.
Expected Behavior
for it to just work?
Actual Behavior
Threw errors.
Reproduces How Often
I believe so.
Workarounds
Changed pub use super::user::Entity as User; to pub use super::user::Model as User; and it seemingly compiles fine.
Description
Generated entity files via sea orm cli. Here's what it looks like:
I'm trying to use it in a different lib in the same project:
But it throws:
I genuinely think it has something to do with the DeriveEntityModel trait, and how exactly it converts Model to Entity under the hood.
I genuinely hope this is coherent enough. I've had to type this 3 times already cos I keep accidentally leaving this page, and I'm sleep deprived atp.
Steps to Reproduce
Expected Behavior
for it to just work?Actual Behavior
Threw errors.
Reproduces How Often
I believe so.
Workarounds
Changed
pub use super::user::Entity as User;
topub use super::user::Model as User;
and it seemingly compiles fine.Reproducible Example
Versions
├── sea-orm v1.1.2
│ ├── sea-orm-macros v1.1.2 (proc-macro)
│ │ ├── sea-bae v0.2.1 (proc-macro)
│ ├── sea-query v0.32.1
│ ├── sea-query-binder v0.7.0
│ │ ├── sea-query v0.32.1 (*)
Running Linux.
The text was updated successfully, but these errors were encountered: