Yelp / swagger-gradle-codegen

💫 A Gradle Plugin to generate your networking code from Swagger
Apache License 2.0
412 stars 37 forks source link

How to remove usingPUT? #146

Closed klaszlo8207 closed 3 years ago

klaszlo8207 commented 3 years ago

1, How to remove ALL usingPUT/usingPOST/UsingGET1/using* at the end of the suspend fun?

2, How to remove header:

"X-Operation-ID: blabla"?

3, How to generate responses under models/responses and requests under models/requests?

BTW, Thanks for the library!

klaszlo8207 commented 3 years ago

2, is solved

cortinico commented 3 years ago

1, How to remove ALL usingPUT/usingPOST/UsingGET1/using* at the end of the suspend fun?

Can you provide a sample Swagger file you're using? It's unclear to me what those usingPUT/usingPOST/UsingGET1 are.

3, How to generate responses under models/responses and requests under models/requests?

You can use the outputDir property in your build.gradle file to specify where the output will be placed. However there is no trivial way to specify that responses and requests should be separated (as they're all just models). You can however specify the destination package (and the folder) with the packageName config property.

klaszlo8207 commented 3 years ago

1, solved sorry it was in the spec file: "operationId"

I just simple removed that chars

klaszlo8207 commented 3 years ago

3, What is the class that can I refactor/update to create that two responses/requests directories?

I think this is possible, because we know what is the Request classes and what is the Response classes, so in this way we can seperate it...

cortinico commented 3 years ago

3, What is the class that can I refactor/update to create that two responses/requests directories?

It's the KotlinGenerator class https://github.com/Yelp/swagger-gradle-codegen/blob/master/gradle-plugin/plugin/src/main/java/com/yelp/codegen/KotlinGenerator.kt

klaszlo8207 commented 3 years ago

Thanks, I will try it

cortinico commented 3 years ago

I'll close this issue as it's a mixture of questions. Should you need further support on point 3, please open another issue 👌