зеркало из https://github.com/Azure/autorest.git
detect openapi3 properly (#2700)
This commit is contained in:
Родитель
4a65d18c2f
Коммит
231bcf3531
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
|
|
Загрузка…
Ссылка в новой задаче