Skip to content

Conversation

SamuelMarks
Copy link
Contributor

@SamuelMarks SamuelMarks commented Sep 5, 2025

; [src/code.rs] Fix type elision warning

Basically I am getting this issue:

error[E0277]: the trait bound `models::profiles_tbl::generated::CreateProfilesTbl: ToSchema` is not satisfied
  --> src/routes/profile.rs:67:32
   |
67 |     form: actix_web::web::Json<CreateProfilesTbl>,
   |                                ^^^^^^^^^^^^^^^^^ unsatisfied trait bound

utoipa::ToSchema needs to be on the struct. But it's a bit too specific to make it to this library/cli, and regardless doesn't futureproof dsync.

So this just lets you add arbitrary derives as strings. As many as your heart desires.

--help

  -d, --derive <ADDITIONAL_DERIVES>
          Add these additional derives to each generated `struct`

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change, this was likely overdue.

Though there are some extra changes that should be done:

  • the commit message style we use is conventional/angular (though with the scope of this PR, i might just squash and change the message myself)
  • add tests for this new option (see existing tests for examples)
  • remove the Option wrapping as listed in the comments below

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better, tests are still missing though. See simple_table_sqlite for a simple example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants