Skip to content

Commit

Permalink
Feat : deserializable-endpoint
Browse files Browse the repository at this point in the history
Feat : deserializable endpoints
  • Loading branch information
tonymushah committed Jul 22, 2023
2 parents 0e3b714 + 73ca0d4 commit 3977d21
Show file tree
Hide file tree
Showing 192 changed files with 2,308 additions and 1,119 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target
target
test-output
120 changes: 107 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions mangadex-api-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@
[package]
edition = "2021"
name = "mangadex-api-schema-rust"
version = "0.3.2"
version = "0.4.0"
authors = ["tonymushah <tonymushahdev06@yahoo.com>"]
description = "Response structs and helpers for mangadex-api"
license = "MIT OR Apache-2.0"
resolver = "2"

[dev-dependencies]
tokio = { version = "1", features = ["rt", "macros"]}
serde_json = "1"
jsonxf = "1"
color-print = "0"

[dependencies.reqwest]
version = "0.11.14"
features = [
Expand All @@ -32,7 +38,7 @@ version = "1.0.136"
features = ["derive"]

[dependencies.serde_qs]
version = "0.9.2"
version = "0.12.0"

[dependencies.thiserror]
version = "1.0.30"
Expand All @@ -49,10 +55,11 @@ features = [
]

[dependencies.specta]
version = "1.0.4"
version = "1.0.5"
optional = true
features = [
"uuid"
"uuid",
"url"
]

[dependencies.mangadex-api-types]
Expand All @@ -63,4 +70,4 @@ path = "../mangadex-api-types"
non_exhaustive = []
specta = ["dep:specta", "mangadex-api-types/specta"]
serialize = []
default = ["non_exhaustive"]
default = ["non_exhaustive", "serialize"]
1 change: 1 addition & 0 deletions mangadex-api-schema/src/bind/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO ref https://github.com/tonymushah/mangadex-api/issues/10
5 changes: 3 additions & 2 deletions mangadex-api-schema/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! MangaDex API response object types.

pub mod v5;

mod bind;
use std::borrow::Cow;

use mangadex_api_types::error::schema::MangaDexErrorResponse;
use mangadex_api_types::error::Error;
use mangadex_api_types::{RelationshipType, ResponseType};
use mangadex_api_types::{RelationshipType, ResponseType, ResultType};
use serde::de::DeserializeOwned;
use serde::{Deserialize, Deserializer, Serialize};
use uuid::Uuid;
Expand Down Expand Up @@ -86,6 +86,7 @@ impl<T, E> ApiResult<T, E> {
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
#[cfg_attr(feature = "specta", derive(specta::Type))]
pub struct ApiData<T> {
pub result : ResultType,
pub response: ResponseType,
pub data: T,
}
Expand Down
Loading

0 comments on commit 3977d21

Please sign in to comment.