FBI-451: address CR comments

This commit is contained in:
Rishi Tank 2023-06-19 15:51:03 +01:00
parent f29b7aeb08
commit 69c7fc4f34
No known key found for this signature in database
GPG Key ID: BF025217B93532E7
3 changed files with 8 additions and 7 deletions

View File

@ -222,7 +222,7 @@ export class RedocNormalizedOptions {
return value.map(lang => lang.toLowerCase()) as CodeSamplesLanguage[];
}
return ['json'];
return [CODE_SAMPLE_LANGUAGES.JSON];
}
theme: ResolvedThemeInterface;

View File

@ -76,26 +76,27 @@ describe('Models', () => {
test('should deref the properties of a schema', () => {
const spec = require('./fixtures/properties.json');
parser = new OpenAPIParser(spec, undefined, opts);
const string = 'string';
const example = {
id: 0,
category: {
id: 0,
name: 'string',
name: string,
sub: {
prop1: 'string',
prop1: string,
},
},
name: 'Guru',
photoUrls: ['string'],
photoUrls: [string],
friend: {},
tags: [
{
id: 0,
name: 'string',
name: string,
},
],
status: 'available',
petType: 'string',
petType: string,
};
expect(

View File

@ -84,7 +84,7 @@ export class MediaTypeModel {
const xmlExamples = this.resolveXmlExample(parser, sample as OpenAPIExample);
if (xmlExamples[0]) {
this.examples[subSchema.title].value = xmlExamples[0]?.exampleValue;
this.examples[subSchema.title].value = xmlExamples[0].exampleValue;
}
}
} else {