Schema
/ API Reference / Guards
Schema
/ API Reference / Guards

isObjectSchema

A function that checks if a JSON schema is an JSON object schema.

The Gist

import { isObjectSchema, T_JSONSchema } from '@weser/schema'

const schema: T_JSONSchema = {
  type: 'object',
  properties: {
    name: { type: 'string' },
  },
}

const isObject = isObjectSchema(schema)

Parameters

ParameterTypeDescription
schemaT_JSONSchemaThe JSON schema to check.

Returns

(boolean) Whether the schema is an object schema.

On this page