feat(api): add DELETE /v2/characters/{id} route, v2 test coverage, and OpenAPI spec

Add REST-idiomatic DELETE method as alias for POST .../delete.
Add 8 router-level tests exercising Bearer auth, invalid tokens,
soft delete, export body decoding, and MaxLauncherHR capping.
Create OpenAPI 3.1.0 specification covering all v2 endpoints.
This commit is contained in:
Houmgaor
2026-02-27 12:58:31 +01:00
parent bcfdf48dad
commit 3ad2836088
3 changed files with 773 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ func (s *APIServer) Start() error {
v2Auth.Use(s.AuthMiddleware)
v2Auth.HandleFunc("/characters", s.CreateCharacter).Methods("POST")
v2Auth.HandleFunc("/characters/{id}/delete", s.DeleteCharacter).Methods("POST")
v2Auth.HandleFunc("/characters/{id}", s.DeleteCharacter).Methods("DELETE")
v2Auth.HandleFunc("/characters/{id}/export", s.ExportSave).Methods("GET")
handler := handlers.CORS(