Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Duplicate Model In Swagger File Because Of Same RequestBody variable Name #190

Open
mkvivek opened this issue May 4, 2016 · 1 comment

Comments

@mkvivek
Copy link

mkvivek commented May 4, 2016

Hi All,
we are using SpringFox to generate our Spring Rest API documentation, but having an issue while creating the swagger.json,Swagger version is 2.0("swagger":"2.0").

One of the spring controller we have a set of end points like shown below(marked as bold).

public @responsebody ResponseEntity bulkUpdateEmployee(RequestBody List contactIdList,RequestHeader(Constants.TOKEN_KEY) String authToken) {}

public @responsebody ResponseEntity bulkUpdateCategory(RequestBody List contactIdList,@RequestHeader(Constants.TOKEN_KEY) String authToken) {} etc.

So the Json Created is also having the same

[{"in":"body","name":"contactIdList","description":"contactIdList","required":true,"schema":{"type":"array","items":{"type":"integer","format":"int64"}}},{"name":"categoryId","in":"path","description":"categoryId","required":true,"type":"integer","format":"int64"},{"name":"token","in":"header","description":"authToken","required":true,"type":"string"}],"responses":controller"],"summary":"bulkUpdateEmployee","operationId":"bulkUpdateEmployeeUsingPOST","consumes":["application/json"],"produces":["/"],"parameters":[{"in":"body","name":"contactIdList","description":"contactIdList","required":true,"schema":{"type":"array","items":{"type":"integer","format":"int64"}}},{"name":"employeeId","in":"path","description":"employeeId","required":true,"type":"integer","format":"int64"}

While importing the tool is giving error like " contactIdList is duplicate and the same model name already exist" because of the same name and parameters.

Is there a way to overcome this ?

Thanks in advance.
Vivek

@kahouieong
Copy link

Swagger/OpenAPI import is now generally available in the API Gateway REST API, the AWS CLI and all AWS SDKs. You can also import and export Swagger definitions using the API Gateway console. This release addresses many of the open issues and feedback in this repository.

I would encourage you to migrate your workflow to the standard AWS tools. aws-apigateway-importer will receive minimal support from the API Gateway team going forward.

Any feedback or issues with the new importer should be directed to the official API Gateway forums

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants