© 2026 Hedgehog Software, LLC
import { scope, Type } from "arktype"; const ValidationErrorResponse = scope({ ErrorDescription: { message: "string", code: "'VALIDATION'", }, Response: { code: "400", contents: { errors: "ErrorDescription[]>0", }, }, }).export().Response; const mytype: Type = ValidationErrorResponse;
2.0.0-dev.19
2.0.0-dev.20
Type 'Type<{ code: 400; contents: { errors: of<{ message: string; code: "VALIDATION"; }[], MoreThanLength<0>>; }; }, { Response: { code: 400; contents: { errors: of<{ message: string; code: "VALIDATION"; }[], MoreThanLength<...>>; }; }; ErrorDescription: { ...; }; }>' is not assignable to type 'Type<unknown, {}>'. The types returned by '$.type(...)' are incompatible between these types. Type 'Type<any, { Response: { code: 400; contents: { errors: of<{ message: string; code: "VALIDATION"; }[], MoreThanLength<0>>; }; }; ErrorDescription: { message: string; code: "VALIDATION"; }; }>' is not assignable to type 'Type<any, {}>'. Type '{}' is not assignable to type '{ Response: { code: 400; contents: { errors: of<{ message: string; code: "VALIDATION"; }[], MoreThanLength<0>>; }; }; ErrorDescription: { message: string; code: "VALIDATION"; }; }'.
Join the Discord to ask follow-up questions and connect with the community
This is a friendly space centered around ArkType, TypeScript's 1:1 validator (https://github.com/arktypeio/arktype)
860 Members