Skip to content

Commit 0bf54dd

Browse files
committed
update samples
1 parent 8c4743c commit 0bf54dd

6 files changed

Lines changed: 126 additions & 126 deletions

File tree

samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Category.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ export interface Category {
3232
*/
3333
name?: string;
3434
}
35+
export const CategoryPropertyValidationAttributesMap: {
36+
[property: string]: {
37+
maxLength?: number,
38+
minLength?: number,
39+
pattern?: string,
40+
maximum?: number,
41+
exclusiveMaximum?: boolean,
42+
minimum?: number,
43+
exclusiveMinimum?: boolean,
44+
multipleOf?: number,
45+
maxItems?: number,
46+
minItems?: number,
47+
uniqueItems?: boolean
48+
}
49+
} = {
50+
name: {
51+
pattern: '/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/',
52+
},
53+
}
54+
3555

3656
/**
3757
* Check if a given object implements the Category interface.
@@ -71,23 +91,3 @@ export function CategoryToJSONTyped(value?: Category | null, ignoreDiscriminator
7191
};
7292
}
7393

74-
export const CategoryPropertyValidationAttributesMap: {
75-
[property: string]: {
76-
maxLength?: number,
77-
minLength?: number,
78-
pattern?: string,
79-
maximum?: number,
80-
exclusiveMaximum?: boolean,
81-
minimum?: number,
82-
exclusiveMinimum?: boolean,
83-
multipleOf?: number,
84-
maxItems?: number,
85-
minItems?: number,
86-
uniqueItems?: boolean
87-
}
88-
} = {
89-
name: {
90-
pattern: '/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/',
91-
},
92-
}
93-

samples/client/petstore/typescript-fetch/builds/validation-attributes/models/ModelApiResponse.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ export interface ModelApiResponse {
3838
*/
3939
message?: string;
4040
}
41+
export const ModelApiResponsePropertyValidationAttributesMap: {
42+
[property: string]: {
43+
maxLength?: number,
44+
minLength?: number,
45+
pattern?: string,
46+
maximum?: number,
47+
exclusiveMaximum?: boolean,
48+
minimum?: number,
49+
exclusiveMinimum?: boolean,
50+
multipleOf?: number,
51+
maxItems?: number,
52+
minItems?: number,
53+
uniqueItems?: boolean
54+
}
55+
} = {
56+
}
57+
4158

4259
/**
4360
* Check if a given object implements the ModelApiResponse interface.
@@ -79,20 +96,3 @@ export function ModelApiResponseToJSONTyped(value?: ModelApiResponse | null, ign
7996
};
8097
}
8198

82-
export const ModelApiResponsePropertyValidationAttributesMap: {
83-
[property: string]: {
84-
maxLength?: number,
85-
minLength?: number,
86-
pattern?: string,
87-
maximum?: number,
88-
exclusiveMaximum?: boolean,
89-
minimum?: number,
90-
exclusiveMinimum?: boolean,
91-
multipleOf?: number,
92-
maxItems?: number,
93-
minItems?: number,
94-
uniqueItems?: boolean
95-
}
96-
} = {
97-
}
98-

samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Order.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,28 @@ export const OrderStatusEnum = {
6969
} as const;
7070
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
7171

72+
export const OrderPropertyValidationAttributesMap: {
73+
[property: string]: {
74+
maxLength?: number,
75+
minLength?: number,
76+
pattern?: string,
77+
maximum?: number,
78+
exclusiveMaximum?: boolean,
79+
minimum?: number,
80+
exclusiveMinimum?: boolean,
81+
multipleOf?: number,
82+
maxItems?: number,
83+
minItems?: number,
84+
uniqueItems?: boolean
85+
}
86+
} = {
87+
}
88+
89+
export const OrderAdditionalPropertiesValidationAttributes: { maxProperties?: number, minProperties?: number } = {
90+
maxProperties: 10,
91+
minProperties: 2,
92+
}
93+
7294

7395
/**
7496
* Check if a given object implements the Order interface.
@@ -118,25 +140,3 @@ export function OrderToJSONTyped(value?: Order | null, ignoreDiscriminator: bool
118140
};
119141
}
120142

121-
export const OrderPropertyValidationAttributesMap: {
122-
[property: string]: {
123-
maxLength?: number,
124-
minLength?: number,
125-
pattern?: string,
126-
maximum?: number,
127-
exclusiveMaximum?: boolean,
128-
minimum?: number,
129-
exclusiveMinimum?: boolean,
130-
multipleOf?: number,
131-
maxItems?: number,
132-
minItems?: number,
133-
uniqueItems?: boolean
134-
}
135-
} = {
136-
}
137-
138-
export const OrderAdditionalPropertiesValidationAttributes: { maxProperties?: number, minProperties?: number } = {
139-
maxProperties: 10,
140-
minProperties: 2,
141-
}
142-

samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Pet.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,28 @@ export const PetStatusEnum = {
8484
} as const;
8585
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
8686

87+
export const PetPropertyValidationAttributesMap: {
88+
[property: string]: {
89+
maxLength?: number,
90+
minLength?: number,
91+
pattern?: string,
92+
maximum?: number,
93+
exclusiveMaximum?: boolean,
94+
minimum?: number,
95+
exclusiveMinimum?: boolean,
96+
multipleOf?: number,
97+
maxItems?: number,
98+
minItems?: number,
99+
uniqueItems?: boolean
100+
}
101+
} = {
102+
photoUrls: {
103+
maxItems: 8,
104+
minItems: 1,
105+
uniqueItems: true,
106+
},
107+
}
108+
87109

88110
/**
89111
* Check if a given object implements the Pet interface.
@@ -133,25 +155,3 @@ export function PetToJSONTyped(value?: Pet | null, ignoreDiscriminator: boolean
133155
};
134156
}
135157

136-
export const PetPropertyValidationAttributesMap: {
137-
[property: string]: {
138-
maxLength?: number,
139-
minLength?: number,
140-
pattern?: string,
141-
maximum?: number,
142-
exclusiveMaximum?: boolean,
143-
minimum?: number,
144-
exclusiveMinimum?: boolean,
145-
multipleOf?: number,
146-
maxItems?: number,
147-
minItems?: number,
148-
uniqueItems?: boolean
149-
}
150-
} = {
151-
photoUrls: {
152-
maxItems: 8,
153-
minItems: 1,
154-
uniqueItems: true,
155-
},
156-
}
157-

samples/client/petstore/typescript-fetch/builds/validation-attributes/models/Tag.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ export interface Tag {
3232
*/
3333
name?: string;
3434
}
35+
export const TagPropertyValidationAttributesMap: {
36+
[property: string]: {
37+
maxLength?: number,
38+
minLength?: number,
39+
pattern?: string,
40+
maximum?: number,
41+
exclusiveMaximum?: boolean,
42+
minimum?: number,
43+
exclusiveMinimum?: boolean,
44+
multipleOf?: number,
45+
maxItems?: number,
46+
minItems?: number,
47+
uniqueItems?: boolean
48+
}
49+
} = {
50+
}
51+
3552

3653
/**
3754
* Check if a given object implements the Tag interface.
@@ -71,20 +88,3 @@ export function TagToJSONTyped(value?: Tag | null, ignoreDiscriminator: boolean
7188
};
7289
}
7390

74-
export const TagPropertyValidationAttributesMap: {
75-
[property: string]: {
76-
maxLength?: number,
77-
minLength?: number,
78-
pattern?: string,
79-
maximum?: number,
80-
exclusiveMaximum?: boolean,
81-
minimum?: number,
82-
exclusiveMinimum?: boolean,
83-
multipleOf?: number,
84-
maxItems?: number,
85-
minItems?: number,
86-
uniqueItems?: boolean
87-
}
88-
} = {
89-
}
90-

samples/client/petstore/typescript-fetch/builds/validation-attributes/models/User.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,34 @@ export interface User {
6868
*/
6969
userStatus?: number;
7070
}
71+
export const UserPropertyValidationAttributesMap: {
72+
[property: string]: {
73+
maxLength?: number,
74+
minLength?: number,
75+
pattern?: string,
76+
maximum?: number,
77+
exclusiveMaximum?: boolean,
78+
minimum?: number,
79+
exclusiveMinimum?: boolean,
80+
multipleOf?: number,
81+
maxItems?: number,
82+
minItems?: number,
83+
uniqueItems?: boolean
84+
}
85+
} = {
86+
password: {
87+
maxLength: 256,
88+
minLength: 8,
89+
},
90+
userStatus: {
91+
maximum: 100,
92+
exclusiveMaximum: true,
93+
minimum: 0,
94+
exclusiveMinimum: true,
95+
multipleOf: 10,
96+
},
97+
}
98+
7199

72100
/**
73101
* Check if a given object implements the User interface.
@@ -119,31 +147,3 @@ export function UserToJSONTyped(value?: User | null, ignoreDiscriminator: boolea
119147
};
120148
}
121149

122-
export const UserPropertyValidationAttributesMap: {
123-
[property: string]: {
124-
maxLength?: number,
125-
minLength?: number,
126-
pattern?: string,
127-
maximum?: number,
128-
exclusiveMaximum?: boolean,
129-
minimum?: number,
130-
exclusiveMinimum?: boolean,
131-
multipleOf?: number,
132-
maxItems?: number,
133-
minItems?: number,
134-
uniqueItems?: boolean
135-
}
136-
} = {
137-
password: {
138-
maxLength: 256,
139-
minLength: 8,
140-
},
141-
userStatus: {
142-
maximum: 100,
143-
exclusiveMaximum: true,
144-
minimum: 0,
145-
exclusiveMinimum: true,
146-
multipleOf: 10,
147-
},
148-
}
149-

0 commit comments

Comments
 (0)