add-endpoint
/add-endpoint
Dodaje endpoint HTTP lub nowy zasób do API w Spring Boot, z magazynem danych, obsługą błędów i testami.
- Autor
- steamfield ↗
- Repozytorium
- stacks ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 08.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.11.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
Co robi i kiedy
Dodaje endpoint HTTP lub nowy zasób do API w Spring Boot, z magazynem danych, obsługą błędów i testami.
Oryginalny opis (EN)
Add an HTTP endpoint or a new resource to this Spring Boot API with its store, error rows and tests. Use when the user asks for a new endpoint, resource, field, query parameter or HTTP method.
Jak działa
SKILL.md bez nagłówków drugiego poziomu · 11 linii, 235 słów
Podgląd SKILL.md
---
name: add-endpoint
description: Add an HTTP endpoint or a new resource to this Spring Boot API with its store, error rows and tests. Use when the user asks for a new endpoint, resource, field, query parameter or HTTP method.
---
# Add an endpoint
The notes resource is the worked example: `app.notes` (`Note`, `NewNote`, `NotePage`, `NoteStore`, `InMemoryNoteStore`), `app.web.NotesController`, `NotesControllerTest` and the round trip in `ApiIT`. Follow the same path.
1. **Domain.** A new resource gets its own package beside `app.notes` with a `package-info.java` carrying `@NullMarked`: a record for the resource, a record for each request body with Bean Validation constraints, and a store interface with an in-memory `@Component` implementation. It imports nothing from `app.web`, Spring MVC or servlets (`ArchitectureTest` fails otherwise). A new field on notes goes in `Note`, `NewNote` and `InMemoryNoteStore.create`.
2. **Errors.** Throw `AppException` with an existing `ErrorCode` and a detail for the log. A status the table lacks is a new `ErrorCode` row (status, tag, fixed message, retryable) and a row in `docs/http-api.md`.
3. **Controller.** One `@RestController` per resource in `app.web`, mapped under `/v1/<plural-noun>`, with constructor injection. The body is `@Valid @RequestBody`; a create returns `ResponseEntity.created(<read path>)`. Every query parameter is `@RequestParam(name = "...")` with an explicit name, or `QueryParameterGuard` rejects it; path variables are named for the resource (`{orderId}`).
4. **Test.** In a `@WebMvcTest(<Controller>.class)` test with `@Import` of the in-memory store: a success case and one case per failure (bad body, bad query, unknown id, wrong method), each asserting status, the envelope's `tag` and any header. Unit-test the store's validation and paging, and add one round trip to an `*IT` class.
5. Update `docs/http-api.md`, then run `make fmt compile test test-integration`.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · steamfield/stacks | 96 | Apache-2.0 |
| davidelka/ai-engineer-course-starter | 100 | MIT |
| steamfield/stacks | 96 | Apache-2.0 |
| bitpin-dev/bitpin-sdk | 86 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 594ed55fe158 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 2 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 96add-route
Dodaje trasę HTTP lub nowy zasób do API w Axum, z magazynem danych, mapowaniem błędów i testami. - 86add-resource
Dodaje zasób lub endpoint REST do API Hono, wraz ze schematami zod, handlerami i testami kontraktowymi. - 95backend-endpoint
Tworzy endpoint REST lub GraphQL z walidacją, obsługą błędów i testami. - 90add-api-endpoint
Dodaje lub rozszerza endpoint HTTP lub API: nową trasę, handler albo metodę RPC z walidacją żądania i zdefiniowaną odpowiedzią. - 100api-scaffolder
Tworzy nowy endpoint API z trasą, handlerem, walidacją, sprawdzeniem uprawnień, testami i OpenAPI, zgodnie z konwencjami projektu. - 100api-first
Tworzy i implementuje endpointy REST lub zasoby w projekcie Spring Boot, zwłaszcza z fragmentu lub specyfikacji OpenAPI: kontrolery, CRUD oraz operacje POST, GET, PUT, PATCH i DELETE.