fix descriptions and propgate required as x-required

This commit is contained in:
Garrett Serack 2019-12-18 14:47:35 -08:00
Родитель b140a181be
Коммит 52017e691d
11 изменённых файлов: 17 добавлений и 15 удалений

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

@ -34,7 +34,7 @@ export class Class extends Type {
namespace.addClass(this);
if (!this.description.trim()) {
this.description = `FIXME: Class ${name} is MISSING DESCRIPTION`;
this.description = '';
}
}

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

@ -34,7 +34,7 @@ export class Field extends Variable {
this.apply(objectInitializer);
if (!this.description.trim()) {
this.description = `FIXME: Field ${name} is MISSING DESCRIPTION`;
this.description = '';
}
}

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

@ -15,7 +15,7 @@ export class Interface extends Type {
parent.addInterface(this);
if (!this.description.trim()) {
this.description = `FIXME: Interface ${name} is MISSING DESCRIPTION`;
this.description = '';
}
}

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

@ -43,10 +43,10 @@ export class Method extends Statements {
}
if (!this.description.trim()) {
this.description = `FIXME: Method ${name} is MISSING DESCRIPTION`;
this.description = '';
}
if (!this.returnsDescription.trim()) {
this.returnsDescription = `FIXME: Method ${name} <returns> is MISSING DESCRIPTION`;
this.returnsDescription = '';
}
}

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

@ -31,7 +31,7 @@ export class Parameter extends Variable {
this.apply(objectInitializer);
if (!this.description.trim()) {
this.description = `FIXME: Parameter ${name} is MISSING DESCRIPTION`;
this.description = '';
}
}

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

@ -55,7 +55,7 @@ export class Property extends Variable implements Instance {
this.apply(objectInitializer);
if (!this.description.trim()) {
this.description = `FIXME: Property ${name} is MISSING DESCRIPTION`;
this.description = '';
}
}
@ -172,8 +172,8 @@ ${indent(g, 2)}
const e = `${this.value}.${methodName}(${parameters.joinWith(valueOf)})`;
return intersect(
toExpression(e), {
implementation: `${e};`
});
implementation: `${e};`
});
}
}

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

@ -60,7 +60,7 @@ export class CommandOperation extends Extensions implements CommandOperation {
this.details = {
default: {
uid: `command-operation:${uid()}`,
description: 'MISSING DESCRIPTION 01',
description: initializer?.description || '',
name,
}
};

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

@ -170,7 +170,7 @@ export class NewResponse extends Extensions implements NewResponse {
default: {
uid: `response:${uid()}`,
isErrorResponse: false,
description: 'MISSING DESCRIPTION 09',
description: description || objectInitializer?.description || '',
name: `${responseCode} ${mimeTypes.join(' ')}`,
}
};
@ -194,7 +194,7 @@ export class HttpOperation extends Extensions implements HttpOperation {
this.details = {
default: {
uid: `http-operation:${uid()}`,
description: 'MISSING DESCRIPTION 05',
description: initializer?.description || '',
name: operationId,
}
};
@ -253,7 +253,7 @@ export class HttpOperationParameter extends Extensions implements HttpOperationP
this.details = {
default: {
uid: `http-parameter:${uid()}`,
description: 'MISSING DESCRIPTION 06',
description: initializer?.description || '',
location: implementation,
name,
}

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

@ -30,7 +30,7 @@ export class IntrinsicOperation extends Extensions implements IntrinsicOperation
this.details = {
default: {
uid: `intrinsic-operation:${uid()}`,
description: 'MISSING DESCRIPTION 07',
description: initializer?.description || '',
name,
}
};

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

@ -177,7 +177,7 @@ export class Property extends Extensions implements Property {
default: {
readOnly: false,
uid: `property:${uid()}`,
description: 'MISSING DESCRIPTION 03',
description: initializer?.description || '',
name,
required: false
}

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

@ -56,6 +56,8 @@ export class Oai2ToOai3 {
case 'required':
case 'type':
case 'name':
// turn these into x-* properties
param[`x-${key}`] = originalParameter[key];
break;
default:
param[key] = originalParameter[key];