example extractor support add url parameter
This commit is contained in:
Родитель
561e55e3b0
Коммит
3736b09e9c
|
@ -1,5 +1,9 @@
|
|||
# Change Log - oav
|
||||
|
||||
## 09/30/2021 2.9.1
|
||||
|
||||
- Example extractor support add url parameter if define x-ms-parameterized-host
|
||||
|
||||
## 09/30/2021 2.9.0
|
||||
|
||||
- Rename test scenario to API scenario
|
||||
|
|
|
@ -145,6 +145,7 @@ export class XMsExampleExtractor {
|
|||
const parsedUrl = url.parse(recordingEntry.RequestUri, true);
|
||||
let recordingPath = parsedUrl.href || "";
|
||||
queryParams = parsedUrl.query || {};
|
||||
const hostUrl = parsedUrl ? parsedUrl.protocol! + "//" + parsedUrl.hostname! : undefined;
|
||||
|
||||
const headerParams = recordingEntry.RequestHeaders;
|
||||
|
||||
|
@ -167,6 +168,9 @@ export class XMsExampleExtractor {
|
|||
const index = v;
|
||||
pathParamsValues[p] = recordingPathParts[index];
|
||||
}
|
||||
if (hostUrl !== undefined) {
|
||||
pathParamsValues.url = hostUrl;
|
||||
}
|
||||
|
||||
// found a match in the recording
|
||||
const requestMethodFromRecording = recordingEntry.RequestMethod;
|
||||
|
@ -240,7 +244,9 @@ export class XMsExampleExtractor {
|
|||
body: responseBody,
|
||||
};
|
||||
}
|
||||
log.info(`Writing x-ms-examples at ${outputExamples + exampleFileName}`);
|
||||
log.info(
|
||||
`Writing x-ms-examples at ${pathlib.resolve(outputExamples, exampleFileName)}`
|
||||
);
|
||||
const examplePath = pathlib.join(outputExamples, exampleFileName);
|
||||
const dir = pathlib.dirname(examplePath);
|
||||
mkdirRecursiveSync(dir);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "2.9.0",
|
||||
"version": "2.9.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "oav",
|
||||
"version": "2.9.0",
|
||||
"version": "2.9.1",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation",
|
||||
"email": "azsdkteam@microsoft.com",
|
||||
|
|
Загрузка…
Ссылка в новой задаче