You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
openapi: 3.0.0info:
description: >- This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \version: 1.0.0title: OpenAPI Petstorelicense:
name: Apache-2.0url: 'http://www.apache.org/licenses/LICENSE-2.0.html'paths:
/foo:
get:
parameters:
- $ref: '#/components/parameters/TestQuery'responses:
default:
description: responsecontent:
application/json:
schema:
$ref: '#/components/schemas/Foo'servers:
- url: http://localhost:8080/description: The local servercomponents:
parameters:
TestQuery:
name: testQuerydescription: test queryin: queryschema:
$ref: '#/components/schemas/Bar'schemas:
Foo:
type: objectproperties:
bar:
$ref: '#/components/schemas/Bar'Bar:
type: stringformat: uuid
Sample code using a generated codes from the spec
funmain(args:Array<String>) {
val api =DefaultApi()
println(api.fooGet(UUID.randomUUID()))
}
Before
Exception in thread "main" java.lang.IllegalArgumentException: Platform class java.util.UUID annotated [] requires explicit JsonAdapter to be registered
at com.squareup.moshi.ClassJsonAdapter$1.create(ClassJsonAdapter.java:51)
at com.squareup.moshi.Moshi.adapter(Moshi.java:100)
at com.squareup.moshi.KotlinJsonAdapterFactory.create(KotlinJsonAdapter.kt:184)
at com.squareup.moshi.Moshi.adapter(Moshi.java:100)
at com.squareup.moshi.Moshi.adapter(Moshi.java:62)
at org.openapitools.client.apis.DefaultApi.fooGet(DefaultApi.kt:173)
at org.openapitools.client.MainKt.main(Main.kt:8)
* Add custom type adapter to deserialize UUID
* Update samples
./bin/kotlin-client-threetenbp.sh
./bin/kotlin-client-string.sh
./bin/kotlin-client-petstore.sh
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.master,. Default:3.4.x,4.0.xmaster.Description of the PR
This PR fixes#1733
Sample spec
Sample spec
Sample code using a generated codes from the spec
Before
After