Two more oatpp 1.3 spec quirks surfaced when fewo-webapp's #469
increment 2 wired up Orval's strict Zod codegen on top of the v0.4.1
`required: []` strip:
- `"type": "Any"` is emitted for `oatpp::Any` / `oatpp::Fields` fields.
OpenAPI 3.0 has no "Any" type — the empty schema `{}` (or absence of
`type`) is the canonical "any value" form. Strip the offending key
recursively across the whole spec.
- Some endpoints emit the same path parameter twice (same `name` + same
`in: path`). Dedupe by `(name, in)` preserving first occurrence.
These were caught only by `@scalar/openapi-parser`'s strict mode (used by
Orval's Zod project); the fetch-client project tolerated them. Without
both fixes, fewoZod fails with `must NOT have duplicate items` and
`must match exactly one schema in oneOf` per affected component.
Bumps to v0.4.2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
oatpp 1.3 emits `"required": []` on schemas with no required fields.
OpenAPI 3.0.x rejects this with "must NOT have fewer than 1 items",
which silently breaks strict consumers. Orval's typed fetch client
swallowed it (the violation surfaces only as a non-fatal warning), but
Orval's Zod generator (added downstream in fewo-webapp's #469 increment 2)
fails hard:
must NOT have fewer than 1 items at /components/schemas/<DTO>/required
must have required property '$ref' at /components/schemas/<DTO>
must match exactly one schema in oneOf at /components/schemas/<DTO>
83 of fewo-webapp's 198 DTOs trip this. Stripping the empty array (absence
of the keyword has the same semantics) is the spec-compliant fix.
Bumps to v0.4.1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace substring `html.replace(old_src, new_src)` with a regex anchored
to <script src="…"> / <link href="…"> attribute values. Inert occurrences
in comments, JSON literals, or unrelated attributes are left alone.
Loud warning (stderr) when zero matches occur — previously the script
silently skipped a typo'd old_src.
Also rewrites <link href> in the same pass so adjacent CSS hashing doesn't
need a follow-up edit.
Tests: tests/test_inject_hashed_filenames.py covers happy path (both quote
styles, extra attributes), inert-substring cases (comment, JSON literal,
data-attr, anchor href), and link-href rewriting.
Closes#3
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bootstraps the shared frontend build glue for webapp-template-derived
projects:
bin/fetch-openapi.sh — pull Swagger JSON from a running backend
bin/postprocess-openapi.py — fix oatpp 1.3 rough edges before orval
bin/inject-hashed-filenames.py — rewrite HTML tags, config-driven
src/vite-config.ts — defineAdminConfig / defineGuestConfig
templates/orval.config.template.ts — starting point for derived repos
Package name @uschuster/webapp-scaffold. Consumed as a devDependency
through the internal Forgejo npm registry; binaries exposed for use in
package.json scripts. createCoreFetch + i18n deferred to v0.2 / v0.3.
Closes fewo-webapp#414
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>