Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
fix: update typescript definition with last added options
Browse files Browse the repository at this point in the history
  • Loading branch information
joolfe committed Sep 18, 2021
1 parent 513ed85 commit 4f83072
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
7 changes: 6 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ export interface Options {
auth?: AuthOptions,
servers?: Array<ServerObject>,
externalDocs?: ExternalDocsObject,
folders?: FoldersOption
folders?: FoldersOption,
// Default value true
responseHeaders?: boolean,
// Default value false
replaceVars?: boolean,
additionalVars?: { [key: string]: string }
}

export default function postmanToOpenApi (input: string, output?: string, options?: Options) : string
21 changes: 21 additions & 0 deletions types/typescript-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,25 @@ const options:Options = {
folders
};

const options2:Options = {
info,
defaultTag: 'my Tag',
pathDepth: 0,
auth: {
'basicAuth': basicAuth,
'bearerAuth': bearerAuth
},
servers: [serverDev, serverPro],
externalDocs,
folders,
responseHeaders: false,
replaceVars: false,
additionalVars: {
'key': 'value',
'key2': 'value2'
}
};

(async () => {

const openAPI1 = postmanToOpenApi('./path/to/postman_collection.json')
Expand All @@ -80,4 +99,6 @@ const options:Options = {

const openAPI3 = postmanToOpenApi('./path/to/postman_collection.json', './path/to/result/openApi.yml', options)

const openAPI4 = postmanToOpenApi('./path/to/postman_collection.json', './path/to/result/openApi.yml', options2)

})();

0 comments on commit 4f83072

Please sign in to comment.