Skip to content

Commit 8d96b09

Browse files
committed
Typo
1 parent e1a0f55 commit 8d96b09

22 files changed

Lines changed: 33 additions & 11 deletions

content/en/labs/a7.openapi-specification.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ path = "src/bin/apidoc.rs"
367367

368368
## Update justfile
369369

370+
Update `book_service/justfile`.
371+
370372
```justfile
371373
# Generate openapi.yaml
372374
apidoc:

content/en/labs/a8.whats-next.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ services:
6565
command: [ "sh", "-c", "/service/migration migration apply && /service/app" ]
6666
restart: always
6767

68-
# db
68+
# db...
6969
```
7070

7171
## Improve for Production
@@ -120,6 +120,14 @@ COPY --from=builder /service/toasty /service/toasty/
120120
CMD ["/service/app"]
121121
```
122122

123+
> [!tip]
124+
> Update `book_service/justfile`.
125+
> ```justfile
126+
> # Build production distroless image
127+
> build-for-prod:
128+
> docker build --build-context workspace_root=../../ -t book-service-app -f prod.Dockerfile .
129+
> ```
130+
123131
### Add `mimalloc`
124132
125133
Run `cargo add mimalloc` from the book_service folder. Then update `book_service/src/bin/app.rs`.
@@ -134,4 +142,10 @@ use tracing_subscriber::{EnvFilter, layer::SubscriberExt, util::SubscriberInitEx
134142
static GLOBAL: MiMalloc = MiMalloc;
135143
136144
#[tokio::main]
145+
// ...
137146
```
147+
148+
## Before going to the next…
149+
150+
- [ ] Add new unique column `isbn` to the `books` table, and avoid duplicates.
151+
- [ ] Investigate how to handle HTTP 400s, with a returning JSON response.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang=en-US><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Rust Programming Language Tutorials for Everyone!"><meta name=author content="Dumindu Madunuwan"><meta name=theme-color content="#ffffff" media="(prefers-color-scheme: light)"><meta name=theme-color content="#101010" media="(prefers-color-scheme: dark)"><title>Learning Rust · Rust Programming Language Tutorials for Everyone!</title><link rel=canonical href=https://learning-rust.github.io/><link rel=stylesheet href=/assets/css/home.min.2f64b534694f7783ee00c07c45f130ef260d59af33aefe9e41a6606a53c5de38.css integrity><link href=https://learning-rust.github.io/pagefind/pagefind-component-ui.css rel=stylesheet><link rel=manifest href=/manifest.json><link rel=icon href=/favicon/favicon.ico><link rel=icon href=/favicon/favicon-16x16.png sizes=16x16 type=image/png><link rel=icon href=/favicon/favicon-32x32.png sizes=32x32 type=image/png><link rel=apple-touch-icon href=/favicon/apple-touch-icon.png sizes=180x180><script async src="https://www.googletagmanager.com/gtag/js?id=G-FZHQCXSZ89"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-FZHQCXSZ89")</script><meta property="og:title" content="Learning Rust"><meta property="og:description" content="Learning Rust - Rust Programming Language Tutorials for Everyone!"><meta property="og:type" content="article"><meta property="og:url" content="https://learning-rust.github.io/"><meta property="og:image" content="https://learning-rust.github.io/og.jpg"><meta property="og:site_name" content="Learning Rust"><meta name=twitter:card content="summary_large_image"><meta name=twitter:title content="Learning Rust"><meta name=twitter:description content="Learning Rust - Rust Programming Language Tutorials for Everyone!"><meta name=twitter:image content="https://learning-rust.github.io/og.jpg"><script type=application/ld+json>{"@context":"https://schema.org","@type":"Article","headline":"Learning Rust","description":"Learning Rust - Rust Programming Language Tutorials for Everyone!","image":"https:\/\/learning-rust.github.io\/og.jpg","author":{"@type":"Person","name":"Dumindu Madunuwan","url":"https:\/\/github.com\/dumindu"},"publisher":{"@type":"Organization","name":"Learning Rust","logo":{"@type":"ImageObject","url":"https:\/\/learning-rust.github.io\/"}},"dateModified":"2026-08-18T20:02:39Z","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/learning-rust.github.io\/"}}</script></head><body><div id=content-wrapper><header id=site-header><div id=site-header-logo><a href=https://learning-rust.github.io/><img height=52px src=https://learning-rust.github.io/logo.svg alt="Site Logo"></a></div><div id=site-header-actions><div id=search-box><pagefind-modal-trigger compact=true></pagefind-modal-trigger><pagefind-modal></pagefind-modal></div><div id=theme-dropdown class=dropdown><button class=dropdown-btn aria-haspopup=menu aria-label="Select the theme">
1+
<!doctype html><html lang=en-US><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Rust Programming Language Tutorials for Everyone!"><meta name=author content="Dumindu Madunuwan"><meta name=theme-color content="#ffffff" media="(prefers-color-scheme: light)"><meta name=theme-color content="#101010" media="(prefers-color-scheme: dark)"><title>Learning Rust · Rust Programming Language Tutorials for Everyone!</title><link rel=canonical href=https://learning-rust.github.io/><link rel=stylesheet href=/assets/css/home.min.2f64b534694f7783ee00c07c45f130ef260d59af33aefe9e41a6606a53c5de38.css integrity><link href=https://learning-rust.github.io/pagefind/pagefind-component-ui.css rel=stylesheet><link rel=manifest href=/manifest.json><link rel=icon href=/favicon/favicon.ico><link rel=icon href=/favicon/favicon-16x16.png sizes=16x16 type=image/png><link rel=icon href=/favicon/favicon-32x32.png sizes=32x32 type=image/png><link rel=apple-touch-icon href=/favicon/apple-touch-icon.png sizes=180x180><script async src="https://www.googletagmanager.com/gtag/js?id=G-FZHQCXSZ89"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-FZHQCXSZ89")</script><meta property="og:title" content="Learning Rust"><meta property="og:description" content="Learning Rust - Rust Programming Language Tutorials for Everyone!"><meta property="og:type" content="article"><meta property="og:url" content="https://learning-rust.github.io/"><meta property="og:image" content="https://learning-rust.github.io/og.jpg"><meta property="og:site_name" content="Learning Rust"><meta name=twitter:card content="summary_large_image"><meta name=twitter:title content="Learning Rust"><meta name=twitter:description content="Learning Rust - Rust Programming Language Tutorials for Everyone!"><meta name=twitter:image content="https://learning-rust.github.io/og.jpg"><script type=application/ld+json>{"@context":"https://schema.org","@type":"Article","headline":"Learning Rust","description":"Learning Rust - Rust Programming Language Tutorials for Everyone!","image":"https:\/\/learning-rust.github.io\/og.jpg","author":{"@type":"Person","name":"Dumindu Madunuwan","url":"https:\/\/github.com\/dumindu"},"publisher":{"@type":"Organization","name":"Learning Rust","logo":{"@type":"ImageObject","url":"https:\/\/learning-rust.github.io\/"}},"dateModified":"2026-08-18T20:30:08Z","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/learning-rust.github.io\/"}}</script></head><body><div id=content-wrapper><header id=site-header><div id=site-header-logo><a href=https://learning-rust.github.io/><img height=52px src=https://learning-rust.github.io/logo.svg alt="Site Logo"></a></div><div id=site-header-actions><div id=search-box><pagefind-modal-trigger compact=true></pagefind-modal-trigger><pagefind-modal></pagefind-modal></div><div id=theme-dropdown class=dropdown><button class=dropdown-btn aria-haspopup=menu aria-label="Select the theme">
22
<span><svg class="icon" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-96q-79 0-149-30t-122.5-82.5T126-331 96-480q0-80 30.5-149.5t84-122 125-82.5T488-864q78 0 146.5 27T754-763t80.5 110T864-518q0 96-67 163t-163 67h-68q-8 0-14 5t-6 13q0 15 15 25t15 53q0 37-27 66.5T480-96zm0-384zm-173.5 18.5Q324-479 324-504t-17.5-42.5T264-564t-42.5 17.5T204-504t17.5 42.5T264-444t42.5-17.5zm120-144Q444-623 444-648t-17.5-42.5T384-708t-42.5 17.5T324-648t17.5 42.5T384-588t42.5-17.5zm192 0Q636-623 636-648t-17.5-42.5T576-708t-42.5 17.5T516-648t17.5 42.5T576-588t42.5-17.5zm120 144Q756-479 756-504t-17.5-42.5T696-564t-42.5 17.5T636-504t17.5 42.5T696-444t42.5-17.5zM480-168q11 0 17.5-8.5T504-192q0-16-15-28t-15-50 26.5-64 64.5-26h69q66 0 112-46t46-112q0-115-88.5-194.5T488-792q-134 0-227 91t-93 221 91 221 221 91z"/></svg>
33
</span><span><svg class="icon" height="20" viewBox="0 -960 960 960" width="20"><path d="m480-246 85.91-85.91Q577-343 591.5-343t25.5 11 11 25.5-10.93 25.43L505-169q-5.4 5-11.7 7.5t-13.5 2.5-13.5-2.5T455-169L342.93-281.07Q332-292 332.5-306.5T344-332t25.5-11 25.47 11.09L480-246zm0-468-85.91 85.91Q383-617 368.5-617T343-628t-11-25.5 10.93-25.43L455-791q5.4-5 11.7-7.5t13.5-2.5 13.5 2.5T505-791l112.07 112.07Q628-668 628-654t-11 25-25.5 11-25.59-10.97L480-714z"/></svg></span></button><ul role=menu class=dropdown-menu><li role=menuitem><button title=Light class=color-scheme data-value=light style=background:#fff;color:#000>
44
<span style=color:#000>Aa</span></button></li><li role=menuitem><button title=dark class=color-scheme data-value=dark style=background:#101010;color:#fff>

docs/labs/openapi-specification/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang=en-US><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Rust Programming Language Tutorials for Everyone!"><meta name=author content="Dumindu Madunuwan"><meta name=theme-color content="#ffffff" media="(prefers-color-scheme: light)"><meta name=theme-color content="#101010" media="(prefers-color-scheme: dark)"><title>OpenAPI Specification · Learning Rust</title><link rel=canonical href=https://learning-rust.github.io/labs/openapi-specification/><link rel=stylesheet href=/assets/css/labs.min.38e0cd9128e98534a0f57aefcd43b960a862ae3a52b7ebe67677e6a117295e73.css integrity><link href=https://learning-rust.github.io/pagefind/pagefind-component-ui.css rel=stylesheet><link rel=manifest href=/manifest.json><link rel=icon href=/favicon/favicon.ico><link rel=icon href=/favicon/favicon-16x16.png sizes=16x16 type=image/png><link rel=icon href=/favicon/favicon-32x32.png sizes=32x32 type=image/png><link rel=apple-touch-icon href=/favicon/apple-touch-icon.png sizes=180x180><script async src="https://www.googletagmanager.com/gtag/js?id=G-FZHQCXSZ89"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-FZHQCXSZ89")</script><meta property="og:title" content="OpenAPI Specification"><meta property="og:description" content="OpenAPI Specification - Rust Programming Language Tutorials for Everyone!"><meta property="og:type" content="article"><meta property="og:url" content="https://learning-rust.github.io/labs/openapi-specification/"><meta property="og:image" content="https://learning-rust.github.io/labs/openapi-specification/og.jpg"><meta property="og:site_name" content="Learning Rust"><meta name=twitter:card content="summary_large_image"><meta name=twitter:title content="OpenAPI Specification"><meta name=twitter:description content="OpenAPI Specification - Rust Programming Language Tutorials for Everyone!"><meta name=twitter:image content="https://learning-rust.github.io/labs/openapi-specification/og.jpg"><script type=application/ld+json>{"@context":"https://schema.org","@type":"Article","headline":"OpenAPI Specification","description":"OpenAPI Specification - Rust Programming Language Tutorials for Everyone!","image":"https:\/\/learning-rust.github.io\/labs\/openapi-specification\/og.jpg","author":{"@type":"Person","name":"Dumindu Madunuwan","url":"https:\/\/github.com\/dumindu"},"publisher":{"@type":"Organization","name":"Learning Rust","logo":{"@type":"ImageObject","url":"https:\/\/learning-rust.github.io\/"}},"dateModified":"2026-08-18T08:52:43Z","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/learning-rust.github.io\/labs\/openapi-specification\/"}}</script></head><body><aside id=left-sidebar><div><button class=btn>
1+
<!doctype html><html lang=en-US><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Rust Programming Language Tutorials for Everyone!"><meta name=author content="Dumindu Madunuwan"><meta name=theme-color content="#ffffff" media="(prefers-color-scheme: light)"><meta name=theme-color content="#101010" media="(prefers-color-scheme: dark)"><title>OpenAPI Specification · Learning Rust</title><link rel=canonical href=https://learning-rust.github.io/labs/openapi-specification/><link rel=stylesheet href=/assets/css/labs.min.38e0cd9128e98534a0f57aefcd43b960a862ae3a52b7ebe67677e6a117295e73.css integrity><link href=https://learning-rust.github.io/pagefind/pagefind-component-ui.css rel=stylesheet><link rel=manifest href=/manifest.json><link rel=icon href=/favicon/favicon.ico><link rel=icon href=/favicon/favicon-16x16.png sizes=16x16 type=image/png><link rel=icon href=/favicon/favicon-32x32.png sizes=32x32 type=image/png><link rel=apple-touch-icon href=/favicon/apple-touch-icon.png sizes=180x180><script async src="https://www.googletagmanager.com/gtag/js?id=G-FZHQCXSZ89"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-FZHQCXSZ89")</script><meta property="og:title" content="OpenAPI Specification"><meta property="og:description" content="OpenAPI Specification - Rust Programming Language Tutorials for Everyone!"><meta property="og:type" content="article"><meta property="og:url" content="https://learning-rust.github.io/labs/openapi-specification/"><meta property="og:image" content="https://learning-rust.github.io/labs/openapi-specification/og.jpg"><meta property="og:site_name" content="Learning Rust"><meta name=twitter:card content="summary_large_image"><meta name=twitter:title content="OpenAPI Specification"><meta name=twitter:description content="OpenAPI Specification - Rust Programming Language Tutorials for Everyone!"><meta name=twitter:image content="https://learning-rust.github.io/labs/openapi-specification/og.jpg"><script type=application/ld+json>{"@context":"https://schema.org","@type":"Article","headline":"OpenAPI Specification","description":"OpenAPI Specification - Rust Programming Language Tutorials for Everyone!","image":"https:\/\/learning-rust.github.io\/labs\/openapi-specification\/og.jpg","author":{"@type":"Person","name":"Dumindu Madunuwan","url":"https:\/\/github.com\/dumindu"},"publisher":{"@type":"Organization","name":"Learning Rust","logo":{"@type":"ImageObject","url":"https:\/\/learning-rust.github.io\/"}},"dateModified":"2026-08-18T20:30:08Z","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/learning-rust.github.io\/labs\/openapi-specification\/"}}</script></head><body><aside id=left-sidebar><div><button class=btn>
22
<svg height="20" viewBox="0 -960 960 960" width="20"><path d="M480-429 316-265q-11 11-25 10.5T266-266t-11-25.5 11-25.5l163-163-164-164q-11-11-10.5-25.5T266-695t25.5-11 25.5 11l163 164 164-164q11-11 25.5-11t25.5 11 11 25.5T695-644L531-480l164 164q11 11 11 25t-11 25-25.5 11T644-266L480-429z"/></svg>
33
Close</button></div><a href=https://learning-rust.github.io/ class=site-logo><img height=52px src=https://learning-rust.github.io/logo.svg alt="Site Logo"></a><nav aria-label="Laboratory Pages"><details open><summary>Laboratory</summary><ul><li><a href=https://learning-rust.github.io/labs/overview/>Overview</a></li></ul></details><details open><summary>RESTful API Workspace</summary><ul><li><a href=https://learning-rust.github.io/labs/building-a-containerized-restful-api/>Building a Containerized RESTful API</a></li><li><a href=https://learning-rust.github.io/labs/initialize-the-server/>Initialize the Server</a></li><li><a href=https://learning-rust.github.io/labs/configuration-and-middleware/>Configuration and Middleware</a></li><li><a href=https://learning-rust.github.io/labs/database-and-db-migrations/>Database and DB Migrations</a></li><li><a href=https://learning-rust.github.io/labs/routes-and-error-responses/>Routes and Error Responses</a></li><li><a href=https://learning-rust.github.io/labs/form-validation/>Form Validation</a></li><li><a href=https://learning-rust.github.io/labs/openapi-specification/ class=active aria-current=page>OpenAPI Specification</a></li><li><a href=https://learning-rust.github.io/labs/whats-next/>What's Next?</a></li></ul></details></nav></aside><div id=content-wrapper><header id=site-header><div id=site-header-logo><a href=https://learning-rust.github.io/><img height=52px src=https://learning-rust.github.io/logo.svg alt="Site Logo"></a></div><div id=site-header-actions><div id=search-box><pagefind-modal-trigger compact=true></pagefind-modal-trigger><pagefind-modal></pagefind-modal></div><div id=theme-dropdown class=dropdown><button class=dropdown-btn aria-haspopup=menu aria-label="Select the theme">
44
<span><svg class="icon" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-96q-79 0-149-30t-122.5-82.5T126-331 96-480q0-80 30.5-149.5t84-122 125-82.5T488-864q78 0 146.5 27T754-763t80.5 110T864-518q0 96-67 163t-163 67h-68q-8 0-14 5t-6 13q0 15 15 25t15 53q0 37-27 66.5T480-96zm0-384zm-173.5 18.5Q324-479 324-504t-17.5-42.5T264-564t-42.5 17.5T204-504t17.5 42.5T264-444t42.5-17.5zm120-144Q444-623 444-648t-17.5-42.5T384-708t-42.5 17.5T324-648t17.5 42.5T384-588t42.5-17.5zm192 0Q636-623 636-648t-17.5-42.5T576-708t-42.5 17.5T516-648t17.5 42.5T576-588t42.5-17.5zm120 144Q756-479 756-504t-17.5-42.5T696-564t-42.5 17.5T636-504t17.5 42.5T696-444t42.5-17.5zM480-168q11 0 17.5-8.5T504-192q0-16-15-28t-15-50 26.5-64 64.5-26h69q66 0 112-46t46-112q0-115-88.5-194.5T488-792q-134 0-227 91t-93 221 91 221 221 91z"/></svg>
@@ -279,7 +279,7 @@
279279
</span></span></span><span class=line><span class=cl><span class=w> </span><span class=n>file</span><span class=p>.</span><span class=n>write_all</span><span class=p>(</span><span class=n>yaml</span><span class=p>.</span><span class=n>as_bytes</span><span class=p>()).</span><span class=n>expect</span><span class=p>(</span><span class=s>&#34;Failed to write data stream into the yaml file&#34;</span><span class=p>);</span><span class=w>
280280
</span></span></span><span class=line><span class=cl><span class=p>}</span></span></span></code></pre></div><p>Update <code>book_service/Cargo.toml</code> to add the <code>apidoc</code> <code>[[bin]]</code>.</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=cl><span class=p>[[</span><span class=l>bin]]</span><span class=w>
281281
</span></span></span><span class=line><span class=cl><span class=l>name = &#34;apidoc&#34;</span><span class=w>
282-
</span></span></span><span class=line><span class=cl><span class=l>path = &#34;src/bin/apidoc.rs&#34;</span></span></span></code></pre></div><h2 id=update-justfile>Update justfile</h2><div class=highlight><pre tabindex=0 class=chroma><code class=language-justfile data-lang=justfile><span class=line><span class=cl><span class=c># Generate openapi.yaml
282+
</span></span></span><span class=line><span class=cl><span class=l>path = &#34;src/bin/apidoc.rs&#34;</span></span></span></code></pre></div><h2 id=update-justfile>Update justfile</h2><p>Update <code>book_service/justfile</code>.</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-justfile data-lang=justfile><span class=line><span class=cl><span class=c># Generate openapi.yaml
283283
</span></span></span><span class=line><span class=cl><span class=nf>apidoc</span><span class=o>:</span>
284284
</span></span><span class=line><span class=cl> cargo run --bin apidoc
285285
</span></span></code></pre></div><div class="alert alert-tip"><div class=alert-header><svg height="20" viewBox="0 -960 960 960" width="20"><path d="M407.74-240Q378-240 357-261.15 336-282.3 336-312v-67q-57-37.3-88.5-95.65T216-6e2q0-110.31 76.78-187.16 76.78-76.84 187-76.84T667-787.16q77 76.85 77 187.16.0 66.82-31.5 125.41T624-379v67q0 29.7-21.18 50.85Q581.65-240 551.91-240H407.74zm.26-72h144v-86q0-9.29 4-17.64 4-8.36 12-12.92l17-10.93q41-25.51 64-68.69T672-6e2q0-79.68-56.23-135.84-56.22-56.16-136-56.16Q4e2-792 344-735.84 288-679.68 288-6e2q0 48.64 23 91.82t64 68.69l17 10.93q8 4.56 12 12.92 4 8.35 4 17.64v86zM396-96q-15.3.0-25.65-10.29Q360-116.58 360-131.79t10.35-25.71Q380.7-168 396-168h168q15.3.0 25.65 10.29Q6e2-147.42 6e2-132.21t-10.35 25.71Q579.3-96 564-96H396zm84-504z"/></svg>

0 commit comments

Comments
 (0)