Contributions
Re: Bug when generating Java client-side code - duplicate parameter ?
I created a sample TEST API which demonstrates the issue. It is a public API. I also addedswaggerhub-support as a collaborator to this API. The API is here: https://app.swaggerhub.com/apis/hibu/TEST_API_001/1.0.0 If you generate from this API Client SDK code in Java, you will see the issue. Several methods are generated which all have duplicate parameters like e.g. public Response findAvailableNumbersByTheirIds(Integer numberId, Integer numberId) throws ApiException { ... } Of course this Java code does not compile. Please take a look.593Views0likes0CommentsRe: Bug when generating Java client-side code - duplicate parameter ?
Hello MConneely , What other info do you need? I provided the exact scenario under which the code generation fails. You say it should generate this but I saw it doesn't generate it this way. I login tohttps://app.swaggerhub.com/so I guess it's SaaS. Do you want me to create a sample API definition and refer you to it? Thanks in advance.626Views0likes2CommentsBug when generating Java client-side code - duplicate parameter ?
Hello, We have an API which has an endpoint which defines two parameters like these: parameters: - name: number_id in: path description: The group id. required: true schema: type: integer description: The group id. format: int32 ... - name: NumberId in: query description: Id of number. schema: type: integer description: Id of number. format: int32 nullable: true ... It is not our own API, we got the API definition file from one of our vendors. So I have no control over the API definition JSON/YAML file. When I import it in SwaggerHub it is marked as VALID. But later, when I try to generate client-side java code from it in SwaggerHub (from that same valid API definition), I getcode generated this way public SomeResponseModel apiNumbersNumberIdConversationsGet(Integer numberId, ..., Integer numberId, ...) throws ApiException { ... } And this of course doesn't compile because it has duplicate numberId parameter. Is this a bug in the Swagger Hub codegen module? Seems to me it's just assigning the same Java parameter name for two different endpoint parameters, which doesn't seem right. Thanks in advance.707Views0likes4Comments