JsonParameterStore
@tsed/schema
Usage
typescript
import { JsonParameterStore } from "@tsed/schema";
See /packages/specs/schema/src/types/domain/JsonParameterStore.ts.
Overview
ts
class JsonParameterStore extends JsonEntityStore {
paramType: string;
expression: string;
dataPath: string;
pipes: Type<PipeMethods>[];
readonly parameter: JsonParameter;
readonly parent: JsonMethodStore;
constructor(options: JsonParameterStoreOptions);
get nestedGenerics(): Type<any>[][];
set nestedGenerics(nestedGenerics: Type<any>[][]);
get required(): boolean;
set required(value: boolean);
get allowedRequiredValues(): any[];
static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
static get(target: Type<any>, propertyKey: string | symbol, index: number): JsonParameterStore;
isRequired(value: any): boolean;
protected getSchema(type: any): JsonSchema;
protected build(): void;
}
paramType
ts
paramType: string;
expression
ts
expression: string;
dataPath
ts
dataPath: string;
pipes
ts
pipes: Type<PipeMethods>[];
Define pipes can be called by the framework to transform input parameter
readonly parameter
ts
readonly parameter: JsonParameter;
Ref to JsonParameter when the decorated object is a parameter.
readonly parent
ts
readonly parent: JsonMethodStore;
get nestedGenerics
ts
get nestedGenerics(): Type<any>[][];
set nestedGenerics
ts
set nestedGenerics(nestedGenerics: Type<any>[][]);
get required
ts
get required(): boolean;
Return the required state.
set required
ts
set required(value: boolean);
get allowedRequiredValues
ts
get allowedRequiredValues(): any[];
static getParams
ts
static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
static get
ts
static get(target: Type<any>, propertyKey: string | symbol, index: number): JsonParameterStore;
isRequired
ts
isRequired(value: any): boolean;
Check precondition between value, required and allowedRequiredValues to know if the entity is required.
protected getSchema
ts
protected getSchema(type: any): JsonSchema;
protected build
ts
protected build(): void;