fix: writeOnly not respected in response samples

This commit is contained in:
Roman Hotsiy 2018-03-05 13:04:49 +02:00
parent 0f1b6a622e
commit 87abdf79d8
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -45,7 +45,7 @@ export class MediaTypeModel {
this.examples[subSchema.title] = {
value: Sampler.sample(
subSchema.rawSchema,
{ skipReadOnly: this.isRequestType, skipReadWrite: !this.isRequestType },
{ skipReadOnly: this.isRequestType, skipWriteOnly: !this.isRequestType },
parser.spec,
),
};
@ -55,7 +55,7 @@ export class MediaTypeModel {
default: new ExampleModel(parser, {
value: Sampler.sample(
info.schema,
{ skipReadOnly: this.isRequestType, skipReadWrite: !this.isRequestType },
{ skipReadOnly: this.isRequestType, skipWriteOnly: !this.isRequestType },
parser.spec,
),
}),