diff --git a/src/openApi/v2/parser/getMappedType.spec.ts b/src/openApi/v2/parser/getMappedType.spec.ts index 8821b440..8dd847c9 100644 --- a/src/openApi/v2/parser/getMappedType.spec.ts +++ b/src/openApi/v2/parser/getMappedType.spec.ts @@ -2,7 +2,6 @@ import { getMappedType } from './getMappedType'; describe('getMappedType', () => { it('should map types to the basics', () => { - expect(getMappedType('File')).toEqual('binary'); expect(getMappedType('file')).toEqual('binary'); expect(getMappedType('string')).toEqual('string'); expect(getMappedType('date')).toEqual('string'); diff --git a/src/openApi/v2/parser/getMappedType.ts b/src/openApi/v2/parser/getMappedType.ts index a7322756..e44434e2 100644 --- a/src/openApi/v2/parser/getMappedType.ts +++ b/src/openApi/v2/parser/getMappedType.ts @@ -1,5 +1,4 @@ const TYPE_MAPPINGS = new Map([ - ['File', 'binary'], ['file', 'binary'], ['any', 'any'], ['object', 'any'], diff --git a/src/openApi/v3/parser/getMappedType.spec.ts b/src/openApi/v3/parser/getMappedType.spec.ts index 8821b440..8dd847c9 100644 --- a/src/openApi/v3/parser/getMappedType.spec.ts +++ b/src/openApi/v3/parser/getMappedType.spec.ts @@ -2,7 +2,6 @@ import { getMappedType } from './getMappedType'; describe('getMappedType', () => { it('should map types to the basics', () => { - expect(getMappedType('File')).toEqual('binary'); expect(getMappedType('file')).toEqual('binary'); expect(getMappedType('string')).toEqual('string'); expect(getMappedType('date')).toEqual('string'); diff --git a/src/openApi/v3/parser/getMappedType.ts b/src/openApi/v3/parser/getMappedType.ts index a7322756..e44434e2 100644 --- a/src/openApi/v3/parser/getMappedType.ts +++ b/src/openApi/v3/parser/getMappedType.ts @@ -1,5 +1,4 @@ const TYPE_MAPPINGS = new Map([ - ['File', 'binary'], ['file', 'binary'], ['any', 'any'], ['object', 'any'], diff --git a/test/spec/v3.json b/test/spec/v3.json index 892687f8..a2695189 100644 --- a/test/spec/v3.json +++ b/test/spec/v3.json @@ -2241,6 +2241,44 @@ "pattern": "^\\w+$" } } + }, + "File": { + "required": [ + "mime" + ], + "type": "object", + "properties": { + "id": { + "title": "Id", + "type": "string", + "readOnly": true, + "minLength": 1 + }, + "updated_at": { + "title": "Updated at", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "created_at": { + "title": "Created at", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "mime": { + "title": "Mime", + "type": "string", + "maxLength": 24, + "minLength": 1 + }, + "file": { + "title": "File", + "type": "string", + "readOnly": true, + "format": "uri" + } + } } } }