diff --git a/src/services/RedocNormalizedOptions.ts b/src/services/RedocNormalizedOptions.ts index 45e10660..d117a188 100644 --- a/src/services/RedocNormalizedOptions.ts +++ b/src/services/RedocNormalizedOptions.ts @@ -222,7 +222,7 @@ export class RedocNormalizedOptions { return value.map(lang => lang.toLowerCase()) as CodeSamplesLanguage[]; } - return ['json']; + return [CODE_SAMPLE_LANGUAGES.JSON]; } theme: ResolvedThemeInterface; diff --git a/src/services/__tests__/OpenAPIParser.test.ts b/src/services/__tests__/OpenAPIParser.test.ts index 6a69535c..bb63b68f 100644 --- a/src/services/__tests__/OpenAPIParser.test.ts +++ b/src/services/__tests__/OpenAPIParser.test.ts @@ -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( diff --git a/src/services/models/MediaType.ts b/src/services/models/MediaType.ts index a3556d66..71f7eacc 100644 --- a/src/services/models/MediaType.ts +++ b/src/services/models/MediaType.ts @@ -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 {