зеркало из
1
0
Форкнуть 0

Set HttpHeader name and description in new 'language' field

This commit is contained in:
David Wilson 2020-07-14 16:48:37 -07:00
Родитель 80dfcbdce8
Коммит 20af5bf7f2
1 изменённых файлов: 18 добавлений и 10 удалений

Просмотреть файл

@ -1509,12 +1509,16 @@ export class ModelerFour {
const headers = new Array<HttpHeader>();
for (const { key: header, value: hh } of this.resolveDictionary(response.headers)) {
this.use(hh.schema, (n, sch) => {
// Override the name picked from the schema if the header has its own
const hsch = this.processSchema('', sch);
hsch.language.default.name = this.interpret.getName(hsch.language.default.name, hh)
const hsch = this.processSchema(this.interpret.getName(header, sch), sch);
hsch.language.default.header = header;
hsch.language.default.description = this.interpret.getDescription('', hh);
headers.push(new HttpHeader(header, hsch));
headers.push(new HttpHeader(header, hsch, {
language: {
default: {
name: hh['x-ms-client-name'] || header,
description: this.interpret.getDescription('', hh)
}
}
}));
});
}
rsp.protocol.http = SetType(HttpResponse, {
@ -1532,12 +1536,16 @@ export class ModelerFour {
const headers = new Array<HttpHeader>();
for (const { key: header, value: hh } of this.resolveDictionary(response.headers)) {
this.use(hh.schema, (n, sch) => {
// Override the name picked from the schema if the header has its own
const hsch = this.processSchema('', sch);
hsch.language.default.name = this.interpret.getName(hsch.language.default.name, hh)
const hsch = this.processSchema(this.interpret.getName(header, sch), sch);
hsch.language.default.header = header;
hsch.language.default.description = this.interpret.getDescription('', hh);
headers.push(new HttpHeader(header, hsch));
headers.push(new HttpHeader(header, hsch, {
language: {
default: {
name: hh['x-ms-client-name'] || header,
description: this.interpret.getDescription('', hh)
}
}
}));
});
}