Adding JSON and YML as valid extensions for OpenAPI/Swagger spec files (#17297)

* adding more openAPI spec types

* Correcting extension stripping

* PR feedback
This commit is contained in:
Benjin Dubishar
2021-10-07 23:22:21 -07:00
committed by GitHub
parent 26b9b96f10
commit 33d9bfd87f
2 changed files with 4 additions and 3 deletions

View File

@@ -841,7 +841,7 @@ export class ProjectsController {
}
const filters: { [name: string]: string[] } = {};
filters[constants.specSelectionText] = ['yaml'];
filters[constants.specSelectionText] = constants.openApiSpecFileExtensions;
let uris = await vscode.window.showOpenDialog({
canSelectFiles: true,
@@ -892,7 +892,8 @@ export class ProjectsController {
}
outputFolder = folders[0].fsPath;
projectName = path.basename(specPath, constants.yamlFileExtension);
projectName = path.basename(specPath, path.extname(specPath));
newProjectFolder = path.join(outputFolder, projectName);
if (await utils.exists(newProjectFolder)) {