UNPKG

airship-server

Version:

Airship is a framework for Node.JS & TypeScript that helps you to write big, scalable and maintainable API servers.

30 lines (26 loc) 695 B
import {Type} from "../types/Type"; export default class ApiMethodParam { constructor( readonly name: string, readonly type: Type, readonly required: boolean, readonly description: string ) { } public serialize(): Object { return { name: this.name, type: this.type.serialize(), required: this.required, description: this.description } } public static deserialize(raw: any): ApiMethodParam { return new ApiMethodParam( raw['name'], Type.deserialize(raw['type']), raw['required'], raw['description'] ) } }