Closed klaszlo8207 closed 3 years ago
Hey @klaszlo8207 I'm sorry but the information you provide is too little to help me even understand what the issue is about. Can you provide a sample Swagger file and a snippet of how the generated code looks like?
sample:
good code:
@POST("signin")
suspend fun SigninUsingPOST( @retrofit2.http.Body `data`: SigninRequest): SignInResponse
generated code:
@POST("signin")
suspend fun SigninUsingPOST( @retrofit2.http.Body 惚ta`: SigninRequest): SignInResponse
Can you provide also your Swagger file (or the fragment that generated this code)?
Sorry it is a private swagger
Sorry it is a private swagger
Can I ask you to create a reproducer (i.e. extract only the fields that are producing the problem and redact the names if needed).
echoing @cortinico here ... having a sample spec that is able to trigger the issue helps us more to identify the bug, ensure that it get fixed and have a test that ensures that no regressions would be present in upcoming releases.
Still by trying to create specs that would create such type of API seems that something like the following might represent a minimal spec
swagger: '2.0'
info:
title: Reproduce https://github.com/Yelp/swagger-gradle-codegen/issues/147
version: 0.0.0
paths:
/signin:
post:
operationId: SigninUsingPOST
parameters:
- in: body
name: data
schema:
type: object
x-model: SigninRequest
properties:
p:
type: integer
required: true
responses:
default:
description: ''
schema:
type: object
properties:
p:
type: string
x-model: SignInResponse
as it would generate (with the kotlin
generator) the following API file
/**
* NOTE: This class is auto generated by the Swagger Gradle Codegen for the following API: JUnit Tests
*
* More info on this tool is available on https://github.com/Yelp/swagger-gradle-codegen
*/
package com.yelp.codegen.generatecodesamples.apis
import com.yelp.codegen.generatecodesamples.models.SignInResponse
import com.yelp.codegen.generatecodesamples.models.SigninRequest
import io.reactivex.Single
import retrofit2.http.Headers
import retrofit2.http.POST
@JvmSuppressWildcards
interface DefaultApi {
/**
* The endpoint is owned by junittests service owner
* @param `data` (required)
*/
@Headers(
"X-Operation-ID: SigninUsingPOST"
)
@POST("/signin")
fun signinUsingPOST(
@retrofit2.http.Body `data`: SigninRequest
): Single<SignInResponse>
}
Is it now fixed? Can I use the new code somehow from maven new version? 1.4.2?
It's fixed but will be available in the upcoming version 👍
It's fixed but will be available in the upcoming version 👍
When will be this available? Thanks
When will be this available? Thanks
We can't really commit on a timeline, but I'm getting @macisamuele onboard to finalize 2.0.0
. Ideally we should merge those PRs first #110 #114 #104 (there might be a couple more).
please replace ` to `