This commit is contained in:
Garrett Serack 2017-11-08 16:17:25 -08:00 коммит произвёл Johannes Bader
Родитель 4a65d18c2f
Коммит 231bcf3531
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -159,7 +159,7 @@ export class AutoRest extends EventEmitter {
* @returns Promise<DocumentType> one of:
* - DocumentType.LiterateConfiguration - contains the magic string '\n> see https://aka.ms/autorest'
* - DocumentType.OpenAPI2 - $.swagger === "2.0"
* - DocumentType.OpenAPI3 - $.openapi === "3.0"
* - DocumentType.OpenAPI3 - $.openapi === "3.0.0"
* - DocumentType.Unknown - content does not match a known document type
*
* @see {@link DocumentType}
@ -188,7 +188,7 @@ export async function IdentifyDocument(content: string): Promise<DocumentType> {
}
if (doc) {
return (doc.swagger && doc.swagger === "2.0") ? DocumentType.OpenAPI2 :
(doc.openapi && doc.openapi === "3.0") ? DocumentType.OpenAPI3 :
(doc.openapi && doc.openapi === "3.0.0") ? DocumentType.OpenAPI3 :
DocumentType.Unknown;
}
}

2
src/autorest/interfaces/autorest-core.d.ts поставляемый
Просмотреть файл

@ -349,7 +349,7 @@ export class AutoRest extends EventEmitter {
* @returns Promise<DocumentType> one of:
* - DocumentType.LiterateConfiguration - contains the magic string '\n> see https://aka.ms/autorest'
* - DocumentType.OpenAPI2 - $.swagger === "2.0"
* - DocumentType.OpenAPI3 - $.openapi === "3.0"
* - DocumentType.OpenAPI3 - $.openapi === "3.0.0"
* - DocumentType.Unknown - content does not match a known document type
*
* @see {@link DocumentType}

Просмотреть файл

@ -234,7 +234,7 @@ export async function isConfigurationDocument(content: string): Promise<boolean>
* @returns Promise<DocumentType> one of:
* - DocumentType.LiterateConfiguration - contains the magic string '\n> see https://aka.ms/autorest'
* - DocumentType.OpenAPI2 - $.swagger === "2.0"
* - DocumentType.OpenAPI3 - $.openapi === "3.0"
* - DocumentType.OpenAPI3 - $.openapi === "3.0.0"
* - DocumentType.Unknown - content does not match a known document type
*
* @see {@link DocumentType}