Commit Graph
11 Commits
Author SHA1 Message Date
Jarek Krochmalski aa30a8dc0a replace non-ascii glyphs in generated openapi description strings 2026-09-06 17:38:22 +05:30
Jarek Krochmalski 6893286e04 add an openapi body-field drift check to the generator 2026-09-06 17:38:22 +05:30
Björn StrausmannandJarek Krochmalski 33c0c47855 fix(openapi): recognize bare object type + document existing field on validate (#1532)
* fix(openapi): recognize bare `object` type in annotation parser

The @openapi annotation parser's parseMiniSchema() only recognized the
bare words integer/number/boolean/string as scalar types. Any other
bare word - including `object`, used in 16 route annotations across
the codebase (e.g. severity:object, envVars:object on
POST /api/stacks/{name}/validate) - silently fell through to the
generic string fallback, so these fields were documented in
static/openapi.json as {"type": "string"} instead of
{"type": "object"}.

Add a dedicated branch for bare `object`, producing an opaque object
schema (no declared properties, since the bare word carries no shape
information of its own - a documented shape should use the existing
{...} form).

Verified no other bare non-standard word is used in any body:/resp-*:
annotation line across the 257 route files, so this closes the gap
completely for the current codebase.

Fixes #1531

* docs(openapi): document the existing field on POST /api/stacks/{name}/validate

The handler reads body.existing (an optional boolean, undocumented)
to control self-exclusion of the stack's own running containers/ports
from the cross-stack collision checks - the exact case the endpoint's
own summary advertises as handled. Without it, a client built strictly
from the OpenAPI document has no way to learn the field exists, and
will validate an existing stack the same way as a new one, silently
reintroducing false-positive collision findings against the stack's
own containers.

Add existing:boolean to the body: annotation, plus a one-line
description explaining the true/omitted semantics.

Fixes #1530

---------

Co-authored-by: Jarek Krochmalski <jotka@users.noreply.github.com>
2026-09-06 15:51:12 +05:30
Jarek Krochmalski e7ee9b41c7 add the emergency relocate/reset-mfa scripts the tests exercise 2026-08-27 07:41:02 +02:00
Jarek Krochmalski 9700412a8f updated generate-changelog-page.ts 2026-08-22 09:25:42 +02:00
jarek 088c7dc343 OpenAPI spec at /api/docs with a Scalar viewer, opt-in via FEAT_API_DOCS 2026-08-18 10:05:36 +02:00
Jarek Krochmalski 5c0fa6aa91 add the missing OpenAPI generator (scripts/generate-openapi.ts + scripts/openapi) so a clean checkout builds 2026-08-18 05:12:37 +02:00
jarek 9c451aedf9 v1.0.19 2026-03-02 07:59:58 +01:00
jarek 0b62c5e3bd #96 2026-01-23 14:39:16 +01:00
Viktoras 241b04247e Honor DATA_DIR env var in sqlite operations related to hawser connections 2026-01-23 14:29:24 +01:00
jarek 66e723052d missing scripts 2026-01-03 13:21:38 +01:00