@microsoft/m365-spec-parser 0.2.1-alpha.537ee19c3.0 → 0.2.1-alpha.c6791a9bd.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1934,7 +1934,7 @@ class SpecParser {
1934
1934
  if (isValid) {
1935
1935
  const serverObj = Utils.getServerObject(spec, method.toLocaleLowerCase(), path);
1936
1936
  if (serverObj) {
1937
- apiResult.server = Utils.resolveEnv(serverObj.url);
1937
+ apiResult.server = serverObj.url;
1938
1938
  }
1939
1939
  const authArray = Utils.getAuthArray(operation.security, spec);
1940
1940
  for (const auths of authArray) {
@@ -2091,7 +2091,8 @@ class SpecParser {
2091
2091
  loadSpec() {
2092
2092
  return __awaiter(this, void 0, void 0, function* () {
2093
2093
  if (!this.spec) {
2094
- this.unResolveSpec = (yield this.parser.parse(this.pathOrSpec));
2094
+ const spec = (yield this.parser.parse(this.pathOrSpec));
2095
+ this.unResolveSpec = this.resolveEnvForSpec(spec);
2095
2096
  // Convert swagger 2.0 to openapi 3.0
2096
2097
  if (!this.unResolveSpec.openapi && this.unResolveSpec.swagger === "2.0") {
2097
2098
  const specObj = yield converter__default['default'].convert(this.unResolveSpec, {});
@@ -2128,6 +2129,11 @@ class SpecParser {
2128
2129
  yield fs__default['default'].outputFile(outputSpecPath, resultStr);
2129
2130
  });
2130
2131
  }
2132
+ resolveEnvForSpec(spec) {
2133
+ const specString = JSON.stringify(spec);
2134
+ const specResolved = Utils.resolveEnv(specString);
2135
+ return JSON.parse(specResolved);
2136
+ }
2131
2137
  }
2132
2138
 
2133
2139
  exports.AdaptiveCardGenerator = AdaptiveCardGenerator;