ts-json-schema-generator
Version:
Generate JSON schema from your Typescript sources
17 lines (15 loc) • 547 B
text/typescript
import { Definition } from "../Schema/Definition";
import { SubTypeFormatter } from "../SubTypeFormatter";
import { BaseType } from "../Type/BaseType";
import { StringType } from "../Type/StringType";
export class StringTypeFormatter implements SubTypeFormatter {
public supportsType(type: StringType): boolean {
return type instanceof StringType;
}
public getDefinition(type: StringType): Definition {
return { type: "string" };
}
public getChildren(type: StringType): BaseType[] {
return [];
}
}