-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefinitionGenerator.d.ts
46 lines (46 loc) · 1.34 KB
/
DefinitionGenerator.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { IDefinition, IDefinitionConfig, IServerlessFunctionConfig } from './types';
export declare class DefinitionGenerator {
version: string;
definition: IDefinition;
config: IDefinitionConfig;
/**
* Constructor
* @param serviceDescriptor IServiceDescription
*/
constructor(config: IDefinitionConfig);
parse(): this;
validate(): {
valid: boolean;
context: string[];
warnings: any[];
error?: any[];
};
/**
* Add Paths to OpenAPI Configuration from Serverless function documentation
* @param config Add
*/
readFunctions(config: IServerlessFunctionConfig[]): void;
/**
* Cleans schema objects to make them OpenAPI compatible
* @param schema JSON Schema Object
*/
private cleanSchema;
/**
* Derives Path, Query and Request header parameters from Serverless documentation
* @param documentationConfig
*/
private getParametersFromConfig;
/**
* Derives request body schemas from event documentation configuration
* @param documentationConfig
*/
private getRequestBodiesFromConfig;
private attachExamples;
/**
* Gets response bodies from documentation config
* @param documentationConfig
*/
private getResponsesFromConfig;
private getResponseContent;
private getHttpEvents;
}