Skip to content

feat!: Implement Serialize, Deserialize, and JsonSchema implementations for cot internal types#575

Open
ElijahAhianyo wants to merge 2 commits into
masterfrom
elijah/json-impls
Open

feat!: Implement Serialize, Deserialize, and JsonSchema implementations for cot internal types#575
ElijahAhianyo wants to merge 2 commits into
masterfrom
elijah/json-impls

Conversation

@ElijahAhianyo
Copy link
Copy Markdown
Contributor

@ElijahAhianyo ElijahAhianyo commented May 15, 2026

Related issue or discussion

This should allow the use of cot's internal types in structs where schemas::JsonSchema is derived:

#[derive(Debug, Clone, Serialize, schemars::JsonSchema)]
struct Foo {
  id: Auto<i64>,
  limited_str: LimitedString<128>,
  fk: ForeignKey<Bar>,
  email: Email,
  url: Url
}

Description

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Performance improvement
  • Other (describe above)

Checklist

  • I've read the contributing guide
  • Tests pass locally (just test-all)
  • Code passes clippy (just clippy)
  • Code is properly formatted (cargo fmt)
  • New tests added (regression test for bugs, coverage for new features)
  • Documentation (both code and site) updated (if applicable)

@github-actions github-actions Bot added the C-lib Crate: cot (main library crate) label May 15, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

🐰 Bencher Report

Branchelijah/json-impls
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
empty_router/empty_router📈 view plot
🚷 view threshold
5,693.40 µs
(-6.85%)Baseline: 6,112.09 µs
7,646.01 µs
(74.46%)
json_api/json_api📈 view plot
🚷 view threshold
1,013.50 µs
(-5.71%)Baseline: 1,074.84 µs
1,313.26 µs
(77.17%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
981.35 µs
(-1.09%)Baseline: 992.18 µs
1,196.13 µs
(82.04%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
957.55 µs
(+0.33%)Baseline: 954.43 µs
1,158.71 µs
(82.64%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
16,880.00 µs
(-4.58%)Baseline: 17,690.89 µs
21,192.85 µs
(79.65%)
🐰 View full continuous benchmarking report in Bencher

@ElijahAhianyo ElijahAhianyo changed the title fix!: Implement Serialize, Deserialize, and JsonSchema implementations for cot internal types feat!: Implement Serialize, Deserialize, and JsonSchema implementations for cot internal types May 15, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 74.76636% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot/src/openapi.rs 84.21% 15 Missing ⚠️
cot/src/db.rs 0.00% 12 Missing ⚠️
Flag Coverage Δ
rust 90.00% <74.76%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot/src/common_types.rs 69.11% <ø> (ø)
cot/src/db.rs 84.62% <0.00%> (-1.55%) ⬇️
cot/src/openapi.rs 93.29% <84.21%> (-1.47%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant