From cc7386d22eeaa11a232878a8a3f44a91af744e45 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Thu, 8 Oct 2026 11:40:20 +0200 Subject: [PATCH] fix(14.3-01): ship http body limits in examples/hello - add examples/hello/config/http.yaml so serve, route:list and TestTypedItemRoute work without a manual config step - drop the matching setup step and known-issue notes from README.md and docs/setup/installation.md --- README.md | 11 +---------- docs/setup/installation.md | 11 +---------- examples/hello/config/http.yaml | 5 +++++ 3 files changed, 7 insertions(+), 20 deletions(-) create mode 100644 examples/hello/config/http.yaml diff --git a/README.md b/README.md index 0ee6808..5aee89d 100644 --- a/README.md +++ b/README.md @@ -38,15 +38,7 @@ The `migrate`, `migrate:status`, `migrate:rollback`, `serve` and admin commands CREATE DATABASE hello; ``` -2. Add the request body limits that `serve` and `route:list` require. The example does not ship them yet, and surf needs numeric values, which the string-valued environment overlay cannot supply. Create `config/http.yaml` in `examples/hello`: - - ```yaml - body_limits: - default_bytes: 1048576 - upload_bytes: 10485760 - ``` - -3. Point the binary at the database, give it an application key and an uploads bucket, then migrate and serve: +2. Point the binary at the database, give it an application key and an uploads bucket, then migrate and serve: ```sh ./bin/hello key:generate # prints a base64 key; copy the value @@ -63,7 +55,6 @@ The `migrate`, `migrate:status`, `migrate:rollback`, `serve` and admin commands ### Known issues -- `examples/hello` has no `http.body_limits` configuration, so `serve` and `route:list` fail with `surf: config http.body_limits.default_bytes is required` until you add it as in step 2. The same gap makes the example's `TestTypedItemRoute` fail. - The committed `examples/hello/main.go` is older than what `summer build` generates now, so building the example (or running its tests, which build it) leaves that file modified. Restore it with `git checkout -- examples/hello/main.go` if you do not intend to commit it. ## Repository layout diff --git a/docs/setup/installation.md b/docs/setup/installation.md index c329ee6..a79433a 100644 --- a/docs/setup/installation.md +++ b/docs/setup/installation.md @@ -90,15 +90,7 @@ CREATE DATABASE hello; Configuration comes from YAML files in `config/`. Any key can be overridden with a `SUMMER_` environment variable, in which a double underscore separates path segments: `SUMMER_DATABASE__DSN` sets `database.dsn`. [Configuration](configuration.md) explains the layers. -`serve` and `route:list` need request body limits, and surf reads them as numbers, which the string-valued environment overlay cannot supply. Create `config/http.yaml` in `examples/hello`: - -```yaml -body_limits: - default_bytes: 1048576 - upload_bytes: 10485760 -``` - -Then point the binary at the database, give it the application key and an uploads bucket. Replace the `` markers with your own values, and never commit them: +Point the binary at the database, give it the application key and an uploads bucket. Replace the `` markers with your own values, and never commit them: ```sh export SUMMER_DATABASE__DSN='postgres://acme:@127.0.0.1:5432/hello?sslmode=disable' @@ -122,7 +114,6 @@ From the application directory, `summer migrate`, `summer migrate:status` and `s > [!WARNING] > Known issues in the current framework: > -> - `examples/hello` ships no `http.body_limits` configuration, so `serve` and `route:list` fail with `surf: config http.body_limits.default_bytes is required` until you add `config/http.yaml` as shown above. The same gap makes the example's `TestTypedItemRoute` fail. > - The committed `examples/hello/main.go` is older than what `summer build` generates now, so building the example leaves that file modified. Restore it with `git checkout -- examples/hello/main.go` if you do not intend to commit it. ## Next steps diff --git a/examples/hello/config/http.yaml b/examples/hello/config/http.yaml new file mode 100644 index 0000000..b3fb302 --- /dev/null +++ b/examples/hello/config/http.yaml @@ -0,0 +1,5 @@ +body_limits: + # Request body limits in bytes, required by serve and route:list. Keep them + # YAML numbers: values from the environment are strings and are rejected. + default_bytes: 1048576 + upload_bytes: 10485760