Skip to content

Invalid response model for class with name "File" #1632

@dreambrother

Description

@dreambrother

Documentation generation for class with name File is invalid. I've created a sample project https://github.com/dreambrother/springfox-bug-example with two identical classes File and File1, and used them in a controller:

@RequestMapping(path = "/files/{fileId}", method = RequestMethod.GET) public File file(@PathVariable String fileId) { return new File().id(fileId); } @RequestMapping(path = "/files1/{fileId}", method = RequestMethod.GET) public File1 file1(@PathVariable String fileId) { return new File1().id(fileId); }

File and File1 exist in definition section of generated JSON doc. Documentation for the response with File1 model is valid:

{"description":"OK","schema":{"$ref":"#/definitions/File1"}}

But for the File is not:

{"description":"OK","schema":{"type":"file"}}

Version: 2.6.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions