Skip to content

feat(openapi-server): spec_prefix namespace for sharing one schemas.ts across multiple specs #334

Description

@benjamineckstein

Problem

When multiple specs share a single schemas.ts, schema lookup matches a bare ${Type}Schema name (fastify-type-provider.ts:295) with no per-spec namespace, so spec1.GetUser and spec2.GetUser both resolve to GetUserSchema with no way to disambiguate.

Proposed fix

Add a spec_prefix config field that feeds the lookup (e.g. PublicApiGetUserSchema vs AdminApiGetUserSchema).

Notes

Niche: most multi-spec setups give each spec its own schemas.ts, which already works. Defer until someone hits it. Effort: medium. Source: post-#328 architecture review.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions