@codegena/oapi3ts
Version:
Codegeneration from OAS3 to TypeScript
69 lines (68 loc) • 2.16 kB
TypeScript
import { HasContentType, HasResponses } from '@codegena/definitions/aspects';
import { Oas3Server } from '@codegena/definitions/oas3';
import { Schema } from '@codegena/definitions/json-schema';
/**
* Meta-information about of API method.
*/
export interface ApiMetaInfo {
/**
* Base file file name (without `.json`) that used as a storage.
* `apiSchemaFile` will be appended to external refs as a `$id`.
*
* By default — `domain-api-schema`
*/
apiSchemaFile: string;
baseTypeName: string;
/**
* JSON Schema of body request.
*/
headersSchema: HasContentType<any> | null;
headersModelName: string;
/**
* Mock data, extracted from examples.
*/
mockData: any;
method: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
paramsModelName: string;
/**
* Schema of params (params in `query` and params in `paths`).
*/
paramsSchema: any;
/**
* Absolute URL of method without domain name
* and protocol.
*/
path: string;
/**
* Parameters of method, should get from query.
*/
queryParams: string[];
/**
* Flag to inform an autogenerated service the request is required.
* TODO to do support in ng-api-service
*/
requestIsRequired: boolean;
requestModelName: string;
/**
* JSON Schema of body request.
*/
requestSchema: HasContentType<any> | null;
responseModelName: string;
/**
* JSON Schema of body response.
*
* Combined schema with sub-schema for every status code, or `default`,
* and one more nested level of sub-scheme with content-types of `default`.
*/
responseSchema: HasResponses<HasContentType<Schema>> | null;
/**
* Name of related data types, such be included to file with API Service.
* Usually, related data types returns in result of {@link Convertor.getOAPI3EntryPoints}.
*/
typingsDependencies: string[];
/**
* Directory, where files with {@link typingsDependencies} should be stored.
*/
typingsDirectory: string;
servers: Oas3Server[];
}