File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
components/zod/custom-types Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -10,5 +10,6 @@ export const limitedObject = ({limit}: {limit: number}) =>
1010 } ,
1111 {
1212 message : `Object can't contain more than ${ limit } characters` ,
13+ params : { code : 'OBJECT_SIZE_LIMIT_EXCEEDED' } ,
1314 } ,
1415 ) ;
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ export const ENCODED_ID_LENGTH = 13;
153153export const MAX_META_OBJECT_SYMBOLS = 2000 ;
154154export const MAX_UNVERSIONED_DATA_OBJECT_SYMBOLS = 5000 ;
155155export const MAX_BRANDING_OBJECT_SYMBOLS = 15000 ;
156+ export const MAX_STATE_DATA_OBJECT_SYMBOLS = 50000 ;
156157
157158export const AJV_PATTERN_KEYS_NOT_OBJECT = {
158159 '.*' : {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import {AppRouteHandler} from '@gravity-ui/expresskit';
22
33import { ApiTag } from '../../components/api-docs' ;
44import { makeReqParser , z , zc } from '../../components/zod' ;
5- import { CONTENT_TYPE_JSON } from '../../const' ;
5+ import { CONTENT_TYPE_JSON , MAX_STATE_DATA_OBJECT_SYMBOLS } from '../../const' ;
66import { createState } from '../../services/new/state' ;
77
88import { stateHashModel } from './response-models' ;
@@ -12,7 +12,9 @@ const requestSchema = {
1212 entryId : zc . encodedId ( ) ,
1313 } ) ,
1414 body : z . object ( {
15- data : z . record ( z . string ( ) , z . unknown ( ) ) ,
15+ data : zc . limitedObject ( {
16+ limit : MAX_STATE_DATA_OBJECT_SYMBOLS ,
17+ } ) ,
1618 } ) ,
1719} ;
1820
You can’t perform that action at this time.
0 commit comments