---
lang: en
title: 'API docs: rest.sanitizejsonparse'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.sanitizejsonparse.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [sanitizeJsonParse](./rest.sanitizejsonparse.md)

## sanitizeJsonParse() function

Factory to create a reviver function for `JSON.parse` to sanitize keys

**Signature:**

```typescript
export declare function sanitizeJsonParse(reviver?: (key: any, value: any) => any, prohibitedKeys?: string[]): (key: string, value: any) => any;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

reviver


</td><td>

(key: any, value: any) =&gt; any


</td><td>

_(Optional)_ Reviver function


</td></tr>
<tr><td>

prohibitedKeys


</td><td>

string\[\]


</td><td>

_(Optional)_ An array of keys to be rejected


</td></tr>
</tbody></table>
**Returns:**

(key: string, value: any) =&gt; any


