openapi-graph-types
Version:
The types of the openapi-graph library.
55 lines (54 loc) • 1.57 kB
TypeScript
import { OpenAPIV3 } from "openapi-types";
import { RefEdgeInterface } from ".";
export interface Nodes {
schemas: {
[key: string]: SchemaNodeInterface;
};
}
export declare type NodeConstructor = new (name: string) => NodeInterface;
export interface NodeInterface {
name: string;
}
export declare type SchemaNodeConstructor = new (name: string, content: OpenAPIV3.SchemaObject, isInline: boolean) => SchemaNodeInterface;
export interface SchemaNodeInterface extends NodeInterface {
content: NonArraySchemaNodeContent | ArraySchemaNodeContent;
referencedBy: {
[key: string]: RefEdgeInterface;
};
isInline: boolean;
}
export interface NonArraySchemaNodeContent {
type?: 'boolean' | 'object' | 'number' | 'string' | 'integer';
title?: string;
description?: string;
format?: string;
default?: any;
multipleOf?: number;
maximum?: number;
exclusiveMaximum?: boolean;
minimum?: number;
exclusiveMinimum?: boolean;
maxLength?: number;
minLength?: number;
pattern?: string;
additionalProperties?: boolean | RefEdgeInterface;
maxItems?: number;
minItems?: number;
uniqueItems?: boolean;
maxProperties?: number;
minProperties?: number;
required?: string[];
enum?: any[];
nullable?: boolean;
readOnly?: boolean;
writeOnly?: boolean;
example?: any;
deprecated?: boolean;
properties?: {
[name: string]: RefEdgeInterface;
};
}
export interface ArraySchemaNodeContent {
type: 'array';
items: RefEdgeInterface;
}