Skip to content

ref

@tsed/schema

Usage

typescript
import { ref } from "@tsed/schema";

See /packages/specs/schema/src/fn/ref.ts.

Overview

ts
function ref<T = unknown>(path: string): JsonSchema<T>;
  • path (string): - The reference URI

Description

Create a schema reference from an external or internal $ref URI.

Example

typescript
const UserRef = ref("https://api.example.com/doc/swagger.json#/components/schemas/User");

Released under the MIT License.