@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.
package/dist/index.esm2017.mjs
CHANGED
|
@@ -1879,7 +1879,7 @@ class SpecParser {
|
|
|
1879
1879
|
if (isValid) {
|
|
1880
1880
|
const serverObj = Utils.getServerObject(spec, method.toLocaleLowerCase(), path);
|
|
1881
1881
|
if (serverObj) {
|
|
1882
|
-
apiResult.server =
|
|
1882
|
+
apiResult.server = serverObj.url;
|
|
1883
1883
|
}
|
|
1884
1884
|
const authArray = Utils.getAuthArray(operation.security, spec);
|
|
1885
1885
|
for (const auths of authArray) {
|
|
@@ -2028,7 +2028,8 @@ class SpecParser {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
async loadSpec() {
|
|
2030
2030
|
if (!this.spec) {
|
|
2031
|
-
|
|
2031
|
+
const spec = (await this.parser.parse(this.pathOrSpec));
|
|
2032
|
+
this.unResolveSpec = this.resolveEnvForSpec(spec);
|
|
2032
2033
|
// Convert swagger 2.0 to openapi 3.0
|
|
2033
2034
|
if (!this.unResolveSpec.openapi && this.unResolveSpec.swagger === "2.0") {
|
|
2034
2035
|
const specObj = await converter.convert(this.unResolveSpec, {});
|
|
@@ -2062,6 +2063,11 @@ class SpecParser {
|
|
|
2062
2063
|
}
|
|
2063
2064
|
await fs.outputFile(outputSpecPath, resultStr);
|
|
2064
2065
|
}
|
|
2066
|
+
resolveEnvForSpec(spec) {
|
|
2067
|
+
const specString = JSON.stringify(spec);
|
|
2068
|
+
const specResolved = Utils.resolveEnv(specString);
|
|
2069
|
+
return JSON.parse(specResolved);
|
|
2070
|
+
}
|
|
2065
2071
|
}
|
|
2066
2072
|
|
|
2067
2073
|
export { AdaptiveCardGenerator, ConstantString, ErrorType, ProjectType, SpecParser, SpecParserError, Utils, ValidationStatus, WarningType };
|