Skip to content

refactor: add index route to JSON example#572

Merged
seqre merged 1 commit into
masterfrom
elijah/json-example-route
May 9, 2026
Merged

refactor: add index route to JSON example#572
seqre merged 1 commit into
masterfrom
elijah/json-example-route

Conversation

@ElijahAhianyo
Copy link
Copy Markdown
Contributor

@ElijahAhianyo ElijahAhianyo commented May 9, 2026

Description

Currently, the json example only has the /swagger route, so the / route doesnt work. It's nice to have a root route that just redirects to the /swagger route. This PR does exactly that.

As a bonus, it adds a view name to the index route of the internal SwaggerUI app so downstream users can reverse_redirect to it

Type of change

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

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

github-actions Bot commented May 9, 2026

🐰 Bencher Report

Branchelijah/json-example-route
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,681.30 µs
(-6.64%)Baseline: 6,085.39 µs
7,606.56 µs
(74.69%)
json_api/json_api📈 view plot
🚷 view threshold
1,015.60 µs
(-5.07%)Baseline: 1,069.85 µs
1,305.48 µs
(77.79%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
980.88 µs
(-0.59%)Baseline: 986.72 µs
1,189.50 µs
(82.46%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
948.17 µs
(-0.10%)Baseline: 949.16 µs
1,153.43 µs
(82.20%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
16,654.00 µs
(-5.76%)Baseline: 17,672.83 µs
21,318.54 µs
(78.12%)
🐰 View full continuous benchmarking report in Bencher

@ElijahAhianyo ElijahAhianyo changed the title feat: Add index route to Json Example refactor: Add index route to Json Example May 9, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot/src/openapi/swagger_ui.rs 0.00% 1 Missing ⚠️
Flag Coverage Δ
rust 90.08% <0.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
cot/src/openapi/swagger_ui.rs 0.00% <0.00%> (ø)

... 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.

@seqre seqre changed the title refactor: Add index route to Json Example refactor: add index route to JSON example May 9, 2026
@seqre seqre merged commit fc27306 into master May 9, 2026
43 of 44 checks passed
@seqre seqre deleted the elijah/json-example-route branch May 9, 2026 12:20
@cotbot cotbot Bot mentioned this pull request May 11, 2026
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.

2 participants