UNPKG

@infinite-debugger/swagger-to-ts

Version:

swagger-to-ts is a powerful library that allows you to generate TypeScript code from Swagger documentation or OpenAPI specifications. It simplifies the process of integrating API definitions into your TypeScript projects, saving you time and effort.

35 lines (34 loc) 1.39 kB
import { OpenAPISpecification } from '../models'; import { RequestParameter } from '../models/OpenAPISpecification/Request'; import { Schema } from '../models/OpenAPISpecification/Schema'; export interface FindSchemaReferencedSchemasOptions { /** * The OpenAPI specification to search for referenced schemas. */ openAPISpecification: OpenAPISpecification; /** * The name of the schema to find all referenced schemas for. */ schemaName: string; } /** * Find all schemas referenced by a schema. * * @param options The options to find all referenced schemas for a schema. * @returns All schemas referenced by the schema. */ export declare const findSchemaReferencedSchemas: ({ schemaName, openAPISpecification, }: FindSchemaReferencedSchemasOptions) => string[]; export interface GenerateSchemaFromRequestParametersOptions { /** * The request parameters to generate a schema from. */ requestParameters: RequestParameter[]; } /** * Generate a schema from request parameters. * * @param options The options to generate a schema from request parameters. * @returns The generated schema from the request parameters. */ export declare const generateSchemaFromRequestParameters: ({ requestParameters, }: GenerateSchemaFromRequestParametersOptions) => Schema; export declare const getPrimitiveSchemaType: (schema: Schema) => string;