@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
67 lines (35 loc) • 1.27 kB
Markdown
---
lang: en
title: 'API docs: openapi-v3.jsonorbooleantojson'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/openapi-v3
permalink: /doc/en/lb4/apidocs.openapi-v3.jsonorbooleantojson.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/openapi-v3](./openapi-v3.md) > [jsonOrBooleanToJSON](./openapi-v3.jsonorbooleantojson.md)
## jsonOrBooleanToJSON() function
Helper function used to interpret boolean values as JSON Schemas. See http://json-schema.org/draft-06/json-schema-release-notes.html
**Signature:**
```typescript
export declare function jsonOrBooleanToJSON(jsonOrBool: boolean | JsonSchema): JsonSchema;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
jsonOrBool
</td><td markdown="1">
boolean \| JsonSchema
</td><td markdown="1">
converts boolean values into their representative JSON Schemas
</td></tr>
</tbody></table>
**Returns:**
JsonSchema
A JSON Schema document representing the input value.