diff --git a/CHANGELOG.md b/CHANGELOG.md index c9649ff42..39e90632e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to the Imperative package will be documented in this file. ## Recent Changes -- Enhancement: Added `offSchema` property for ProfileInfo to indicate if argument is a known schema argument [#899](https://github.com/zowe/imperative/issues/899) +- Enhancement: Added `inSchema` property for ProfileInfo to indicate if argument is a known schema argument [#899](https://github.com/zowe/imperative/issues/899) ## `5.16.0` diff --git a/packages/config/__tests__/ProfileInfo.TeamConfig.test.ts b/packages/config/__tests__/ProfileInfo.TeamConfig.test.ts index 109bdd26b..cd05cc12a 100644 --- a/packages/config/__tests__/ProfileInfo.TeamConfig.test.ts +++ b/packages/config/__tests__/ProfileInfo.TeamConfig.test.ts @@ -753,25 +753,25 @@ describe("TeamConfig ProfileInfo tests", () => { } }); - it("should find correct offSchema args", async () => { + it("should find correct inSchema args", async () => { const profInfo = createNewProfInfo(teamProjDir); await profInfo.readProfilesFromDisk(); const profAttrs = profInfo.getAllProfiles()[7] as IProfAttrs; const mergedArgs = profInfo.mergeArgsForProfile(profAttrs); const expectedArgs = [ - { argName: "host", offSchema: false }, - { argName: "port", offSchema: false }, - { argName: "responseFormatHeader", offSchema: true }, - { argName: "fakeOffSchemaArg", offSchema: true }, - { argName: "user", offSchema: false }, - { argName: "password", offSchema: false }, - { argName: "rejectUnauthorized", offSchema: false }, + { argName: "host", inSchema: true }, + { argName: "port", inSchema: true }, + { argName: "responseFormatHeader", inSchema: false }, + { argName: "fakeOffSchemaArg", inSchema: false }, + { argName: "user", inSchema: true }, + { argName: "password", inSchema: true }, + { argName: "rejectUnauthorized", inSchema: true }, ]; expect(mergedArgs.knownArgs.length).toBe(expectedArgs.length); for (const [idx, arg] of mergedArgs.knownArgs.entries()) { - expect(arg.offSchema).toEqual(expectedArgs[idx].offSchema); + expect(arg.inSchema).toEqual(expectedArgs[idx].inSchema); } }); diff --git a/packages/config/src/ProfileInfo.ts b/packages/config/src/ProfileInfo.ts index d38781b0f..0e1f3a197 100644 --- a/packages/config/src/ProfileInfo.ts +++ b/packages/config/src/ProfileInfo.ts @@ -624,7 +624,7 @@ export class ProfileInfo { argValue: propVal, argLoc, secure, - offSchema: true + inSchema: false }); } } @@ -656,7 +656,7 @@ export class ProfileInfo { argValue: propVal, argLoc, secure, - offSchema: true + inSchema: false }); } } @@ -748,7 +748,7 @@ export class ProfileInfo { dataType: this.argDataType(propInfoInSchema.type), argValue: (propInfoInSchema as ICommandProfileProperty).optionDefinition?.defaultValue, argLoc, - offSchema: false, + inSchema: true, // See https://github.com/zowe/imperative/issues/739 secure: foundInSecureArray || propInfoInSchema.secure }; @@ -763,7 +763,7 @@ export class ProfileInfo { if (!argFound) { mergedArgs.missingArgs.push({ argName: propName, - offSchema: false, + inSchema: true, dataType: this.argDataType(propInfoInSchema.type), argValue: (propInfoInSchema as ICommandProfileProperty).optionDefinition?.defaultValue, argLoc: { locType: ProfLocType.DEFAULT }, @@ -771,7 +771,7 @@ export class ProfileInfo { }); } } else { - knownArg.offSchema = false; + knownArg.inSchema = true; knownArg.secure = knownArg.secure ?? propInfoInSchema.secure; if (knownArg.secure) { delete knownArg.argValue; diff --git a/packages/config/src/doc/IProfArgAttrs.ts b/packages/config/src/doc/IProfArgAttrs.ts index 370dda3d4..70c80512a 100644 --- a/packages/config/src/doc/IProfArgAttrs.ts +++ b/packages/config/src/doc/IProfArgAttrs.ts @@ -37,5 +37,5 @@ export interface IProfArgAttrs { secure?: boolean; /** Whether the argument value is defined in the schema file */ - offSchema?: boolean; + inSchema?: boolean; }