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 value.map(lang => lang.toLowerCase()) as CodeSamplesLanguage[];
} }
return ['json']; return [CODE_SAMPLE_LANGUAGES.JSON];
} }
theme: ResolvedThemeInterface; theme: ResolvedThemeInterface;

View File

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

View File

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