-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from Aleph-Alpha/ignore-serde-attributes-when…
…-skipped Ignore serde attributes when #[ts(skip)] is present
- Loading branch information
Showing
8 changed files
with
56 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "ts-rs-macros" | ||
version = "7.0.0" | ||
version = "7.1.0" | ||
authors = ["Moritz Bischof <[email protected]>"] | ||
edition = "2021" | ||
description = "derive macro for ts-rs" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "ts-rs" | ||
version = "7.0.0" | ||
version = "7.1.0" | ||
authors = ["Moritz Bischof <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
|
@@ -37,7 +37,7 @@ chrono = { version = "0.4", features = ["serde"] } | |
|
||
[dependencies] | ||
heapless = { version = "0.7", optional = true } | ||
ts-rs-macros = { version = "7.0.0", path = "../macros" } | ||
ts-rs-macros = { version = "7.1.0", path = "../macros" } | ||
dprint-plugin-typescript = { version = "0.85.1", optional = true } | ||
chrono = { version = "0.4", optional = true } | ||
bigdecimal = { version = ">=0.0.13, < 0.4.0", features = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#![allow(dead_code)] | ||
|
||
// from issue #107. This does now no longer generate a warning. | ||
|
||
use serde::{Deserialize, Serialize}; | ||
use ts_rs::TS; | ||
|
||
fn default_http_version() -> String { | ||
"2".to_owned() | ||
} | ||
|
||
#[derive(Debug, Clone, Deserialize, Serialize, TS)] | ||
#[ts(export)] | ||
pub struct Foobar { | ||
#[ts(skip)] | ||
#[serde(skip, default = "default_http_version")] | ||
pub http_version: String, | ||
pub something_else: i32, | ||
} | ||
|
||
#[test] | ||
fn serde_skip_with_default() { | ||
assert_eq!( | ||
Foobar::decl(), | ||
"interface Foobar { something_else: number, }" | ||
); | ||
} |