forked from swagger-api/swagger-codegen
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kotlin client lists (swagger-api#5729)
* [kotlin] array->List instead of Array Serialization to/from primitive arrays can cause issues with valid responses. This commit considers swagger 'array' types as 'List' which, although not as memory efficient should provide a cleaner interface for users (and avoid serialization issues). Also, updates README.md to list new generator and excludes folder at samples/client/kotlin/bin/, which is not used. * [kotlin] Move sample under conventional directory samples/client/kotlin/ -> samples/client/petstore/kotlin/ Updated new.sh to generate client/server/docs into similar structure. Current documentation generators (cwiki, html, html.md, html2) aren't following a convention like client/server generators.
- Loading branch information
1 parent
9282098
commit 23cf641
Showing
35 changed files
with
58 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
samples/client/kotlin/.gitignore → samples/client/petstore/kotlin/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
./bin/ | ||
# Created by https://www.gitignore.io/api/java,intellij,gradle | ||
|
||
### Intellij ### | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file renamed
BIN
+52.9 KB
.../kotlin/gradle/wrapper/gradle-wrapper.jar → .../kotlin/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
samples/client/petstore/kotlin/src/test/kotlin/io/swagger/client/functional/EvaluateTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.swagger.client.functional | ||
|
||
import io.kotlintest.matchers.should | ||
import io.kotlintest.matchers.beGreaterThan | ||
import io.kotlintest.specs.ShouldSpec | ||
import io.swagger.client.apis.PetApi | ||
|
||
class EvaluateTest : ShouldSpec() { | ||
init { | ||
should("query against pet statuses") { | ||
val api = PetApi() | ||
val results = api.findPetsByStatus(listOf("available", "pending")) | ||
|
||
results.size should beGreaterThan(1) | ||
} | ||
|
||
// TODO: Handle default (200) response | ||
/* | ||
should("post data (new pet)") { | ||
val api = PetApi() | ||
val pet = Pet( | ||
id = 0, | ||
name = "kotlin client test", | ||
category = Category(0, "string"), | ||
tags = listOf(Tag(0, "string")) | ||
) | ||
val result = api.addPet(pet) | ||
result.name shouldBe(pet.name) | ||
result.category shouldBe(pet.category) | ||
result.tags shouldBe(pet.tags) | ||
} | ||
*/ | ||
} | ||
} |