···336336Let's create our schema in the `/lexicons` folder of our codebase. You can [read more about how to define schemas here](#todo).
337337338338```json
339339-/* lexicons/status.json */
339339+/** lexicons/status.json **/
340340{
341341 "lexicon": 1,
342342 "id": "com.example.status",
···371371./node_modules/.bin/lex gen-server ./src/lexicon ./lexicons/*
372372```
373373374374-This will produce Typescript interfaces as well as runtime validation functions that we can use in our `POST /status` route:
374374+This will produce Typescript interfaces as well as runtime validation functions that we can use in our app. Here's what that generated code looks like:
375375+376376+```typescript
377377+/** src/lexicon/types/com/example/status.ts **/
378378+export interface Record {
379379+ status: string
380380+ createdAt: string
381381+ [k: string]: unknown
382382+}
383383+384384+export function isRecord(v: unknown): v is Record {
385385+ return (
386386+ isObj(v) &&
387387+ hasProp(v, '$type') &&
388388+ (v.$type === 'com.example.status#main' || v.$type === 'com.example.status')
389389+ )
390390+}
391391+392392+export function validateRecord(v: unknown): ValidationResult {
393393+ return lexicons.validate('com.example.status#main', v)
394394+}
395395+```
396396+397397+Let's use that code to improve the `POST /status` route:
375398376399```typescript
377400/** src/routes.ts **/