Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import com.squareup.moshi.JsonClass
{{/moshi}}
{{#jackson}}
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonFormat
{{#discriminator}}
import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonTypeInfo
{{/discriminator}}
{{/jackson}}
{{#parcelizeModels}}
import android.os.Parcelable
Expand All @@ -34,7 +37,7 @@ import java.io.Serializable
{{#parcelizeModels}}
@Parcelize
{{/parcelizeModels}}
{{#multiplatform}}@Serializable{{/multiplatform}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{/moshiCodeGen}}{{/moshi}}
{{#multiplatform}}@Serializable{{/multiplatform}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{/moshiCodeGen}}{{/moshi}}{{#jackson}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{/jackson}}
{{#nonPublicApi}}internal {{/nonPublicApi}}{{#discriminator}}interface{{/discriminator}}{{^discriminator}}data class{{/discriminator}} {{classname}}{{^discriminator}} (
{{#vars}}
{{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}}
Expand All @@ -57,7 +60,6 @@ import java.io.Serializable
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
*/
{{#multiplatform}}@Serializable(with = {{nameInCamelCase}}.Serializer::class){{/multiplatform}}
{{#jackson}}{{#isPrimitiveType}}@JsonFormat(shape = JsonFormat.Shape.NATURAL){{/isPrimitiveType}}{{^isPrimitiveType}}@JsonFormat(shape = JsonFormat.Shape.OBJECT){{/isPrimitiveType}}{{/jackson}}
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInCamelCase}}}(val value: {{#isListContainer}}{{{ nestedType }}}{{/isListContainer}}{{^isListContainer}}{{{dataType}}}{{/isListContainer}}){
{{#allowableValues}}
{{#enumVars}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
{{/gson}}
{{#jackson}}
{{#isDateTime}}
@JsonFormat
(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
{{/isDateTime}}
@JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")
{{/jackson}}
{{/multiplatform}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
@JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")
{{/jackson}}
{{/multiplatform}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import com.google.gson.annotations.SerializedName
{{#moshi}}
import com.squareup.moshi.Json
{{/moshi}}
{{#jackson}}
import com.fasterxml.jackson.annotation.JsonProperty
{{/jackson}}
{{/multiplatform}}
{{#multiplatform}}
import kotlinx.serialization.*
Expand All @@ -16,7 +19,6 @@ import kotlinx.serialization.internal.CommonEnumSerializer
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
*/
{{#multiplatform}}@Serializable(with = {{classname}}.Serializer::class){{/multiplatform}}
{{#jackson}}@JsonFormat(shape = JsonFormat.Shape.OBJECT){{/jackson}}
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}){

{{#allowableValues}}{{#enumVars}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
{{#gson}}
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
{{/gson}}
{{#jackson}}
@get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")
{{/jackson}}
{{/multiplatform}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}?
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
{{#gson}}
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
{{/gson}}
{{#jackson}}
@get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")
{{/jackson}}
{{/multiplatform}}
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import java.util.UUID
{{/gson}}
{{#jackson}}
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.annotation.JsonInclude
Expand Down Expand Up @@ -70,5 +71,6 @@ import java.util.Date
.registerModule(Jdk8Module())
.registerModule(JavaTimeModule())
.setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
{{/jackson}}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true)
@JsonSubTypes(
{{#discriminator.mappedModels}}
JsonSubTypes.Type(value = {{modelName}}::class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"){{^-last}},{{/-last}}
{{/discriminator.mappedModels}}
)
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ import com.google.gson.annotations.SerializedName

data class ApiResponse (
@SerializedName("code")
val code: kotlin.Int? = null
,
val code: kotlin.Int? = null,
@SerializedName("type")
val type: kotlin.String? = null
,
val type: kotlin.String? = null,
@SerializedName("message")
val message: kotlin.String? = null

)

Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ import com.google.gson.annotations.SerializedName

data class Category (
@SerializedName("id")
val id: kotlin.Long? = null
,
val id: kotlin.Long? = null,
@SerializedName("name")
val name: kotlin.String? = null

)

Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,25 @@ import com.google.gson.annotations.SerializedName

data class Order (
@SerializedName("id")
val id: kotlin.Long? = null
,
val id: kotlin.Long? = null,
@SerializedName("petId")
val petId: kotlin.Long? = null
,
val petId: kotlin.Long? = null,
@SerializedName("quantity")
val quantity: kotlin.Int? = null
,
val quantity: kotlin.Int? = null,
@SerializedName("shipDate")
val shipDate: java.time.OffsetDateTime? = null
,
val shipDate: java.time.OffsetDateTime? = null,
/* Order Status */
@SerializedName("status")
val status: Order.Status? = null
,
val status: Order.Status? = null,
@SerializedName("complete")
val complete: kotlin.Boolean? = null

) {

/**
* Order Status
* Values: placed,approved,delivered
*/


enum class Status(val value: kotlin.String){
@SerializedName(value="placed") placed("placed"),
@SerializedName(value="approved") approved("approved"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,25 @@ import com.google.gson.annotations.SerializedName

data class Pet (
@SerializedName("name")
val name: kotlin.String
,
val name: kotlin.String,
@SerializedName("photoUrls")
val photoUrls: kotlin.Array<kotlin.String>
,
val photoUrls: kotlin.Array<kotlin.String>,
@SerializedName("id")
val id: kotlin.Long? = null
,
val id: kotlin.Long? = null,
@SerializedName("category")
val category: Category? = null
,
val category: Category? = null,
@SerializedName("tags")
val tags: kotlin.Array<Tag>? = null
,
val tags: kotlin.Array<Tag>? = null,
/* pet status in the store */
@SerializedName("status")
val status: Pet.Status? = null

) {

/**
* pet status in the store
* Values: available,pending,sold
*/


enum class Status(val value: kotlin.String){
@SerializedName(value="available") available("available"),
@SerializedName(value="pending") pending("pending"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ import com.google.gson.annotations.SerializedName

data class Tag (
@SerializedName("id")
val id: kotlin.Long? = null
,
val id: kotlin.Long? = null,
@SerializedName("name")
val name: kotlin.String? = null

)

Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,21 @@ import com.google.gson.annotations.SerializedName

data class User (
@SerializedName("id")
val id: kotlin.Long? = null
,
val id: kotlin.Long? = null,
@SerializedName("username")
val username: kotlin.String? = null
,
val username: kotlin.String? = null,
@SerializedName("firstName")
val firstName: kotlin.String? = null
,
val firstName: kotlin.String? = null,
@SerializedName("lastName")
val lastName: kotlin.String? = null
,
val lastName: kotlin.String? = null,
@SerializedName("email")
val email: kotlin.String? = null
,
val email: kotlin.String? = null,
@SerializedName("password")
val password: kotlin.String? = null
,
val password: kotlin.String? = null,
@SerializedName("phone")
val phone: kotlin.String? = null
,
val phone: kotlin.String? = null,
/* User Status */
@SerializedName("userStatus")
val userStatus: kotlin.Int? = null

)

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.openapitools.client.infrastructure

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.annotation.JsonInclude
Expand All @@ -13,4 +14,5 @@ object Serializer {
.registerModule(Jdk8Module())
.registerModule(JavaTimeModule())
.setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ package org.openapitools.client.models


import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonFormat
/**
* Describes the result of uploading an image resource
* @param code
Expand All @@ -23,13 +22,10 @@ import com.fasterxml.jackson.annotation.JsonFormat

data class ApiResponse (
@JsonProperty("code")
val code: kotlin.Int? = null
,
val code: kotlin.Int? = null,
@JsonProperty("type")
val type: kotlin.String? = null
,
val type: kotlin.String? = null,
@JsonProperty("message")
val message: kotlin.String? = null

)

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ package org.openapitools.client.models


import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonFormat
/**
* A category for a pet
* @param id
Expand All @@ -22,10 +21,8 @@ import com.fasterxml.jackson.annotation.JsonFormat

data class Category (
@JsonProperty("id")
val id: kotlin.Long? = null
,
val id: kotlin.Long? = null,
@JsonProperty("name")
val name: kotlin.String? = null

)

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ package org.openapitools.client.models


import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonFormat
/**
* An order for a pets from the pet store
* @param id
Expand All @@ -26,34 +25,25 @@ import com.fasterxml.jackson.annotation.JsonFormat

data class Order (
@JsonProperty("id")
val id: kotlin.Long? = null
,
val id: kotlin.Long? = null,
@JsonProperty("petId")
val petId: kotlin.Long? = null
,
val petId: kotlin.Long? = null,
@JsonProperty("quantity")
val quantity: kotlin.Int? = null
,
@JsonFormat
(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
val quantity: kotlin.Int? = null,
@JsonProperty("shipDate")
val shipDate: java.time.OffsetDateTime? = null
,
val shipDate: java.time.OffsetDateTime? = null,
/* Order Status */
@JsonProperty("status")
val status: Order.Status? = null
,
val status: Order.Status? = null,
@JsonProperty("complete")
val complete: kotlin.Boolean? = null

) {

/**
* Order Status
* Values: PLACED,APPROVED,DELIVERED
*/

@JsonFormat(shape = JsonFormat.Shape.NATURAL)
enum class Status(val value: kotlin.String){
@JsonProperty(value="placed") PLACED("placed"),
@JsonProperty(value="approved") APPROVED("approved"),
Expand Down
Loading