Libraries v5.0.0
    Preparing search index...

    Collects schemas that carry an explicit component name (set via .schemaName()) and provides a reference-based lookup used during OpenAPI spec generation to replace inline schema objects with $ref: '#/components/schemas/<name>' pointers.

    Conflict rule: registering two different schema instances (different object references) under the same name throws immediately. Use-site aliases register their canonical target; re-registering that target is a no-op.

    const registry = new SchemaRegistry();
    registry.register(UserSchema); // UserSchema.schemaName('User')
    registry.getName(UserSchema); // 'User'
    registry.getName(someOtherSchema); // null
    Index
    • Attempts to register schema in the registry.

      • If the schema has no schemaName in its introspect output, it is silently skipped.
      • If the same instance is already registered, this is a no-op.
      • Use-site modifiers register their canonical definition, not the alias.
      • If a different instance is already registered under the same name, an error is thrown.

      Parameters

      • schema: SchemaBuilder<any, any, any>

        The schema builder to register.

      Returns void

      When two distinct schema instances share the same name.