forked from loafle/openapi-generator-original
[typescript-fetch] fix serialization/deserialization with inheritance (#3767)
* #3646 - fix inheritence * #3646: Fix imports * Update modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com> * generate typeescript-fetch samples
This commit is contained in:
parent
31d7bf9d18
commit
28cf0b279d
@ -12,6 +12,10 @@ export enum {{classname}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function {{classname}}FromJSON(json: any): {{classname}} {
|
export function {{classname}}FromJSON(json: any): {{classname}} {
|
||||||
|
return {{classname}}FromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boolean): {{classname}} {
|
||||||
return json as {{classname}};
|
return json as {{classname}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,20 @@ import {
|
|||||||
{{#imports}}
|
{{#imports}}
|
||||||
{{{.}}},
|
{{{.}}},
|
||||||
{{.}}FromJSON,
|
{{.}}FromJSON,
|
||||||
|
{{.}}FromJSONTyped,
|
||||||
{{.}}ToJSON,
|
{{.}}ToJSON,
|
||||||
{{/imports}}
|
{{/imports}}
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
{{/hasImports}}
|
{{/hasImports}}
|
||||||
|
{{#discriminator}}
|
||||||
|
import {
|
||||||
|
{{#discriminator.mappedModels}}
|
||||||
|
{{modelName}}FromJSONTyped
|
||||||
|
{{/discriminator.mappedModels}}
|
||||||
|
} from './';
|
||||||
|
|
||||||
|
{{/discriminator}}
|
||||||
/**
|
/**
|
||||||
* {{{description}}}
|
* {{{description}}}
|
||||||
* @export
|
* @export
|
||||||
@ -29,8 +38,25 @@ export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function {{classname}}FromJSON(json: any): {{classname}} {
|
export function {{classname}}FromJSON(json: any): {{classname}} {
|
||||||
|
return {{classname}}FromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boolean): {{classname}} {
|
||||||
{{#hasVars}}
|
{{#hasVars}}
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
{{#discriminator}}
|
||||||
|
if (!ignoreDiscriminator) {
|
||||||
|
{{#discriminator.mappedModels}}
|
||||||
|
if (json['{{discriminator.propertyName}}'] === '{{modelName}}') {
|
||||||
|
return {{modelName}}FromJSONTyped(json, true);
|
||||||
|
}
|
||||||
|
{{/discriminator.mappedModels}}
|
||||||
|
}
|
||||||
|
{{/discriminator}}
|
||||||
return {
|
return {
|
||||||
|
{{#parent}}...{{{parent}}}FromJSONTyped(json, ignoreDiscriminator),{{/parent}}
|
||||||
{{#additionalPropertiesType}}
|
{{#additionalPropertiesType}}
|
||||||
...json,
|
...json,
|
||||||
{{/additionalPropertiesType}}
|
{{/additionalPropertiesType}}
|
||||||
@ -79,7 +105,11 @@ export function {{classname}}ToJSON(value?: {{classname}}): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
{{#parent}}...{{{parent}}}ToJSON(value),{{/parent}}
|
||||||
{{#additionalPropertiesType}}
|
{{#additionalPropertiesType}}
|
||||||
...value,
|
...value,
|
||||||
{{/additionalPropertiesType}}
|
{{/additionalPropertiesType}}
|
||||||
|
@ -33,7 +33,15 @@ export interface Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function CategoryFromJSON(json: any): Category {
|
export function CategoryFromJSON(json: any): Category {
|
||||||
|
return CategoryFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function CategoryToJSON(value?: Category): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,15 @@ export interface ModelApiResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
||||||
|
return ModelApiResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': !exists(json, 'code') ? undefined : json['code'],
|
'code': !exists(json, 'code') ? undefined : json['code'],
|
||||||
'type': !exists(json, 'type') ? undefined : json['type'],
|
'type': !exists(json, 'type') ? undefined : json['type'],
|
||||||
'message': !exists(json, 'message') ? undefined : json['message'],
|
'message': !exists(json, 'message') ? undefined : json['message'],
|
||||||
@ -50,7 +58,11 @@ export function ModelApiResponseToJSON(value?: ModelApiResponse): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': value.code,
|
'code': value.code,
|
||||||
'type': value.type,
|
'type': value.type,
|
||||||
'message': value.message,
|
'message': value.message,
|
||||||
|
@ -57,7 +57,15 @@ export interface Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function OrderFromJSON(json: any): Order {
|
export function OrderFromJSON(json: any): Order {
|
||||||
|
return OrderFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
||||||
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
||||||
@ -71,7 +79,11 @@ export function OrderToJSON(value?: Order): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'petId': value.petId,
|
'petId': value.petId,
|
||||||
'quantity': value.quantity,
|
'quantity': value.quantity,
|
||||||
|
@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime';
|
|||||||
import {
|
import {
|
||||||
Category,
|
Category,
|
||||||
CategoryFromJSON,
|
CategoryFromJSON,
|
||||||
|
CategoryFromJSONTyped,
|
||||||
CategoryToJSON,
|
CategoryToJSON,
|
||||||
Tag,
|
Tag,
|
||||||
TagFromJSON,
|
TagFromJSON,
|
||||||
|
TagFromJSONTyped,
|
||||||
TagToJSON,
|
TagToJSON,
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
@ -66,7 +68,15 @@ export interface Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PetFromJSON(json: any): Pet {
|
export function PetFromJSON(json: any): Pet {
|
||||||
|
return PetFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
||||||
'name': json['name'],
|
'name': json['name'],
|
||||||
@ -80,7 +90,11 @@ export function PetToJSON(value?: Pet): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'category': CategoryToJSON(value.category),
|
'category': CategoryToJSON(value.category),
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
|
@ -33,7 +33,15 @@ export interface Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TagFromJSON(json: any): Tag {
|
export function TagFromJSON(json: any): Tag {
|
||||||
|
return TagFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function TagToJSON(value?: Tag): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,15 @@ export interface User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function UserFromJSON(json: any): User {
|
export function UserFromJSON(json: any): User {
|
||||||
|
return UserFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'username': !exists(json, 'username') ? undefined : json['username'],
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
||||||
@ -85,7 +93,11 @@ export function UserToJSON(value?: User): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'username': value.username,
|
'username': value.username,
|
||||||
'firstName': value.firstName,
|
'firstName': value.firstName,
|
||||||
|
@ -33,7 +33,15 @@ export interface Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function CategoryFromJSON(json: any): Category {
|
export function CategoryFromJSON(json: any): Category {
|
||||||
|
return CategoryFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function CategoryToJSON(value?: Category): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,15 @@ export interface ModelApiResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
||||||
|
return ModelApiResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': !exists(json, 'code') ? undefined : json['code'],
|
'code': !exists(json, 'code') ? undefined : json['code'],
|
||||||
'type': !exists(json, 'type') ? undefined : json['type'],
|
'type': !exists(json, 'type') ? undefined : json['type'],
|
||||||
'message': !exists(json, 'message') ? undefined : json['message'],
|
'message': !exists(json, 'message') ? undefined : json['message'],
|
||||||
@ -50,7 +58,11 @@ export function ModelApiResponseToJSON(value?: ModelApiResponse): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': value.code,
|
'code': value.code,
|
||||||
'type': value.type,
|
'type': value.type,
|
||||||
'message': value.message,
|
'message': value.message,
|
||||||
|
@ -57,7 +57,15 @@ export interface Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function OrderFromJSON(json: any): Order {
|
export function OrderFromJSON(json: any): Order {
|
||||||
|
return OrderFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
||||||
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
||||||
@ -71,7 +79,11 @@ export function OrderToJSON(value?: Order): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'petId': value.petId,
|
'petId': value.petId,
|
||||||
'quantity': value.quantity,
|
'quantity': value.quantity,
|
||||||
|
@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime';
|
|||||||
import {
|
import {
|
||||||
Category,
|
Category,
|
||||||
CategoryFromJSON,
|
CategoryFromJSON,
|
||||||
|
CategoryFromJSONTyped,
|
||||||
CategoryToJSON,
|
CategoryToJSON,
|
||||||
Tag,
|
Tag,
|
||||||
TagFromJSON,
|
TagFromJSON,
|
||||||
|
TagFromJSONTyped,
|
||||||
TagToJSON,
|
TagToJSON,
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
@ -66,7 +68,15 @@ export interface Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PetFromJSON(json: any): Pet {
|
export function PetFromJSON(json: any): Pet {
|
||||||
|
return PetFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
||||||
'name': json['name'],
|
'name': json['name'],
|
||||||
@ -80,7 +90,11 @@ export function PetToJSON(value?: Pet): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'category': CategoryToJSON(value.category),
|
'category': CategoryToJSON(value.category),
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
|
@ -33,7 +33,15 @@ export interface Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TagFromJSON(json: any): Tag {
|
export function TagFromJSON(json: any): Tag {
|
||||||
|
return TagFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function TagToJSON(value?: Tag): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,15 @@ export interface User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function UserFromJSON(json: any): User {
|
export function UserFromJSON(json: any): User {
|
||||||
|
return UserFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'username': !exists(json, 'username') ? undefined : json['username'],
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
||||||
@ -85,7 +93,11 @@ export function UserToJSON(value?: User): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'username': value.username,
|
'username': value.username,
|
||||||
'firstName': value.firstName,
|
'firstName': value.firstName,
|
||||||
|
@ -33,7 +33,15 @@ export interface Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function CategoryFromJSON(json: any): Category {
|
export function CategoryFromJSON(json: any): Category {
|
||||||
|
return CategoryFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function CategoryToJSON(value?: Category): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,15 @@ export interface ModelApiResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
||||||
|
return ModelApiResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': !exists(json, 'code') ? undefined : json['code'],
|
'code': !exists(json, 'code') ? undefined : json['code'],
|
||||||
'type': !exists(json, 'type') ? undefined : json['type'],
|
'type': !exists(json, 'type') ? undefined : json['type'],
|
||||||
'message': !exists(json, 'message') ? undefined : json['message'],
|
'message': !exists(json, 'message') ? undefined : json['message'],
|
||||||
@ -50,7 +58,11 @@ export function ModelApiResponseToJSON(value?: ModelApiResponse): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': value.code,
|
'code': value.code,
|
||||||
'type': value.type,
|
'type': value.type,
|
||||||
'message': value.message,
|
'message': value.message,
|
||||||
|
@ -57,7 +57,15 @@ export interface Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function OrderFromJSON(json: any): Order {
|
export function OrderFromJSON(json: any): Order {
|
||||||
|
return OrderFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
||||||
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
||||||
@ -71,7 +79,11 @@ export function OrderToJSON(value?: Order): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'petId': value.petId,
|
'petId': value.petId,
|
||||||
'quantity': value.quantity,
|
'quantity': value.quantity,
|
||||||
|
@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime';
|
|||||||
import {
|
import {
|
||||||
Category,
|
Category,
|
||||||
CategoryFromJSON,
|
CategoryFromJSON,
|
||||||
|
CategoryFromJSONTyped,
|
||||||
CategoryToJSON,
|
CategoryToJSON,
|
||||||
Tag,
|
Tag,
|
||||||
TagFromJSON,
|
TagFromJSON,
|
||||||
|
TagFromJSONTyped,
|
||||||
TagToJSON,
|
TagToJSON,
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
@ -66,7 +68,15 @@ export interface Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PetFromJSON(json: any): Pet {
|
export function PetFromJSON(json: any): Pet {
|
||||||
|
return PetFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
||||||
'name': json['name'],
|
'name': json['name'],
|
||||||
@ -80,7 +90,11 @@ export function PetToJSON(value?: Pet): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'category': CategoryToJSON(value.category),
|
'category': CategoryToJSON(value.category),
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
|
@ -33,7 +33,15 @@ export interface Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TagFromJSON(json: any): Tag {
|
export function TagFromJSON(json: any): Tag {
|
||||||
|
return TagFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function TagToJSON(value?: Tag): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,15 @@ export interface User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function UserFromJSON(json: any): User {
|
export function UserFromJSON(json: any): User {
|
||||||
|
return UserFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'username': !exists(json, 'username') ? undefined : json['username'],
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
||||||
@ -85,7 +93,11 @@ export function UserToJSON(value?: User): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'username': value.username,
|
'username': value.username,
|
||||||
'firstName': value.firstName,
|
'firstName': value.firstName,
|
||||||
|
@ -33,7 +33,15 @@ export interface Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function CategoryFromJSON(json: any): Category {
|
export function CategoryFromJSON(json: any): Category {
|
||||||
|
return CategoryFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function CategoryToJSON(value?: Category): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,15 @@ export interface ModelApiResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
||||||
|
return ModelApiResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': !exists(json, 'code') ? undefined : json['code'],
|
'code': !exists(json, 'code') ? undefined : json['code'],
|
||||||
'type': !exists(json, 'type') ? undefined : json['type'],
|
'type': !exists(json, 'type') ? undefined : json['type'],
|
||||||
'message': !exists(json, 'message') ? undefined : json['message'],
|
'message': !exists(json, 'message') ? undefined : json['message'],
|
||||||
@ -50,7 +58,11 @@ export function ModelApiResponseToJSON(value?: ModelApiResponse): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': value.code,
|
'code': value.code,
|
||||||
'type': value.type,
|
'type': value.type,
|
||||||
'message': value.message,
|
'message': value.message,
|
||||||
|
@ -57,7 +57,15 @@ export interface Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function OrderFromJSON(json: any): Order {
|
export function OrderFromJSON(json: any): Order {
|
||||||
|
return OrderFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
||||||
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
||||||
@ -71,7 +79,11 @@ export function OrderToJSON(value?: Order): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'petId': value.petId,
|
'petId': value.petId,
|
||||||
'quantity': value.quantity,
|
'quantity': value.quantity,
|
||||||
|
@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime';
|
|||||||
import {
|
import {
|
||||||
Category,
|
Category,
|
||||||
CategoryFromJSON,
|
CategoryFromJSON,
|
||||||
|
CategoryFromJSONTyped,
|
||||||
CategoryToJSON,
|
CategoryToJSON,
|
||||||
Tag,
|
Tag,
|
||||||
TagFromJSON,
|
TagFromJSON,
|
||||||
|
TagFromJSONTyped,
|
||||||
TagToJSON,
|
TagToJSON,
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
@ -66,7 +68,15 @@ export interface Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PetFromJSON(json: any): Pet {
|
export function PetFromJSON(json: any): Pet {
|
||||||
|
return PetFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
||||||
'name': json['name'],
|
'name': json['name'],
|
||||||
@ -80,7 +90,11 @@ export function PetToJSON(value?: Pet): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'category': CategoryToJSON(value.category),
|
'category': CategoryToJSON(value.category),
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
|
@ -33,7 +33,15 @@ export interface Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TagFromJSON(json: any): Tag {
|
export function TagFromJSON(json: any): Tag {
|
||||||
|
return TagFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function TagToJSON(value?: Tag): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,15 @@ export interface User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function UserFromJSON(json: any): User {
|
export function UserFromJSON(json: any): User {
|
||||||
|
return UserFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'username': !exists(json, 'username') ? undefined : json['username'],
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
||||||
@ -85,7 +93,11 @@ export function UserToJSON(value?: User): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'username': value.username,
|
'username': value.username,
|
||||||
'firstName': value.firstName,
|
'firstName': value.firstName,
|
||||||
|
@ -33,7 +33,15 @@ export interface Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function CategoryFromJSON(json: any): Category {
|
export function CategoryFromJSON(json: any): Category {
|
||||||
|
return CategoryFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function CategoryToJSON(value?: Category): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,15 @@ export interface ModelApiResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
||||||
|
return ModelApiResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': !exists(json, 'code') ? undefined : json['code'],
|
'code': !exists(json, 'code') ? undefined : json['code'],
|
||||||
'type': !exists(json, 'type') ? undefined : json['type'],
|
'type': !exists(json, 'type') ? undefined : json['type'],
|
||||||
'message': !exists(json, 'message') ? undefined : json['message'],
|
'message': !exists(json, 'message') ? undefined : json['message'],
|
||||||
@ -50,7 +58,11 @@ export function ModelApiResponseToJSON(value?: ModelApiResponse): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': value.code,
|
'code': value.code,
|
||||||
'type': value.type,
|
'type': value.type,
|
||||||
'message': value.message,
|
'message': value.message,
|
||||||
|
@ -57,7 +57,15 @@ export interface Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function OrderFromJSON(json: any): Order {
|
export function OrderFromJSON(json: any): Order {
|
||||||
|
return OrderFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
||||||
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
||||||
@ -71,7 +79,11 @@ export function OrderToJSON(value?: Order): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'petId': value.petId,
|
'petId': value.petId,
|
||||||
'quantity': value.quantity,
|
'quantity': value.quantity,
|
||||||
|
@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime';
|
|||||||
import {
|
import {
|
||||||
Category,
|
Category,
|
||||||
CategoryFromJSON,
|
CategoryFromJSON,
|
||||||
|
CategoryFromJSONTyped,
|
||||||
CategoryToJSON,
|
CategoryToJSON,
|
||||||
Tag,
|
Tag,
|
||||||
TagFromJSON,
|
TagFromJSON,
|
||||||
|
TagFromJSONTyped,
|
||||||
TagToJSON,
|
TagToJSON,
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
@ -66,7 +68,15 @@ export interface Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PetFromJSON(json: any): Pet {
|
export function PetFromJSON(json: any): Pet {
|
||||||
|
return PetFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
||||||
'name': json['name'],
|
'name': json['name'],
|
||||||
@ -80,7 +90,11 @@ export function PetToJSON(value?: Pet): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'category': CategoryToJSON(value.category),
|
'category': CategoryToJSON(value.category),
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
|
@ -33,7 +33,15 @@ export interface Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TagFromJSON(json: any): Tag {
|
export function TagFromJSON(json: any): Tag {
|
||||||
|
return TagFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function TagToJSON(value?: Tag): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,15 @@ export interface User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function UserFromJSON(json: any): User {
|
export function UserFromJSON(json: any): User {
|
||||||
|
return UserFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'username': !exists(json, 'username') ? undefined : json['username'],
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
||||||
@ -85,7 +93,11 @@ export function UserToJSON(value?: User): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'username': value.username,
|
'username': value.username,
|
||||||
'firstName': value.firstName,
|
'firstName': value.firstName,
|
||||||
|
@ -33,7 +33,15 @@ export interface Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function CategoryFromJSON(json: any): Category {
|
export function CategoryFromJSON(json: any): Category {
|
||||||
|
return CategoryFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function CategoryToJSON(value?: Category): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,15 @@ export interface ModelApiResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
||||||
|
return ModelApiResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': !exists(json, 'code') ? undefined : json['code'],
|
'code': !exists(json, 'code') ? undefined : json['code'],
|
||||||
'type': !exists(json, 'type') ? undefined : json['type'],
|
'type': !exists(json, 'type') ? undefined : json['type'],
|
||||||
'message': !exists(json, 'message') ? undefined : json['message'],
|
'message': !exists(json, 'message') ? undefined : json['message'],
|
||||||
@ -50,7 +58,11 @@ export function ModelApiResponseToJSON(value?: ModelApiResponse): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'code': value.code,
|
'code': value.code,
|
||||||
'type': value.type,
|
'type': value.type,
|
||||||
'message': value.message,
|
'message': value.message,
|
||||||
|
@ -57,7 +57,15 @@ export interface Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function OrderFromJSON(json: any): Order {
|
export function OrderFromJSON(json: any): Order {
|
||||||
|
return OrderFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
||||||
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
||||||
@ -71,7 +79,11 @@ export function OrderToJSON(value?: Order): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'petId': value.petId,
|
'petId': value.petId,
|
||||||
'quantity': value.quantity,
|
'quantity': value.quantity,
|
||||||
|
@ -15,9 +15,11 @@ import { exists, mapValues } from '../runtime';
|
|||||||
import {
|
import {
|
||||||
Category,
|
Category,
|
||||||
CategoryFromJSON,
|
CategoryFromJSON,
|
||||||
|
CategoryFromJSONTyped,
|
||||||
CategoryToJSON,
|
CategoryToJSON,
|
||||||
Tag,
|
Tag,
|
||||||
TagFromJSON,
|
TagFromJSON,
|
||||||
|
TagFromJSONTyped,
|
||||||
TagToJSON,
|
TagToJSON,
|
||||||
} from './';
|
} from './';
|
||||||
|
|
||||||
@ -66,7 +68,15 @@ export interface Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function PetFromJSON(json: any): Pet {
|
export function PetFromJSON(json: any): Pet {
|
||||||
|
return PetFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
||||||
'name': json['name'],
|
'name': json['name'],
|
||||||
@ -80,7 +90,11 @@ export function PetToJSON(value?: Pet): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'category': CategoryToJSON(value.category),
|
'category': CategoryToJSON(value.category),
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
|
@ -33,7 +33,15 @@ export interface Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TagFromJSON(json: any): Tag {
|
export function TagFromJSON(json: any): Tag {
|
||||||
|
return TagFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
};
|
};
|
||||||
@ -43,7 +51,11 @@ export function TagToJSON(value?: Tag): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'name': value.name,
|
'name': value.name,
|
||||||
};
|
};
|
||||||
|
@ -69,7 +69,15 @@ export interface User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function UserFromJSON(json: any): User {
|
export function UserFromJSON(json: any): User {
|
||||||
|
return UserFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
'username': !exists(json, 'username') ? undefined : json['username'],
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
||||||
@ -85,7 +93,11 @@ export function UserToJSON(value?: User): any {
|
|||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
|
|
||||||
'id': value.id,
|
'id': value.id,
|
||||||
'username': value.username,
|
'username': value.username,
|
||||||
'firstName': value.firstName,
|
'firstName': value.firstName,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user