Autogenerate only the models of the API for the backend-server
This commit is contained in:
@@ -13,7 +13,6 @@ pub struct ApiError {
|
||||
}
|
||||
|
||||
impl Display for ApiError {
|
||||
// This trait requires `fmt` with this exact signature.
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
write!(f, "{}", self.message)
|
||||
}
|
||||
@@ -81,3 +80,12 @@ impl From<chrono::ParseError> for ApiError {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<uuid::Error> for ApiError {
|
||||
fn from(value: uuid::Error) -> Self {
|
||||
ApiError {
|
||||
status: 422,
|
||||
message: value.to_string()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user