# How to configure array objects in a plugin? Using json\_schema with type: objects?

**URL:** https://meta.discourse.org/t/json-schema-type-objects/405376
**Category:** Development
**Created:** [June 16, 2026, 4:03am UTC](https://meta.discourse.org/t/json-schema-type-objects/405376 "2026-06-16T04:03:39Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [June 16, 2026, 4:03am UTC](https://meta.discourse.org/t/json-schema-type-objects/405376/1 "2026-06-16T04:03:39Z")

</div>

How do I configure array objects in a plugin? I tried using `json_schema`, but object property configuration doesn’t support selectors like `category`; only text input is possible. Meanwhile, `type: objects` simply doesn’t work in plugin configurations at all.

Configuration for `json_schema`:

```yaml
  quectel_online_customer_category_customers:
    default: "[]"
    client: true
    json_schema: QuectelOnlineCustomer::SiteSettings::CategoryCustomersJsonSchema

```

plugins/quectel-online-customer/lib/quectel\_online\_customer/site\_settings/category\_customers\_json\_schema.rb

```glimmer-javascript
# frozen_string_literal: true

module QuectelOnlineCustomer
  module SiteSettings
    class CategoryCustomersJsonSchema
      def self.schema
        @schema ||= begin
          {
            type: "array",
            uniqueItems: true,
            default: [],
            items: {
              type: "object",
              title: "Category Customer Configuration",
              additionalProperties: false, # Prevent submission of undefined fields
              required: %w[category customers], # Both fields are required
              properties: {
                category: {
                  type: "category",
                  description: "The forum category to bind",
                  label: "Category"
                },
                customers: {
                  type: "usernames", # Multi-select users, replacing single username
                  description: "Customer accounts assigned to this category, supports multi-selection",
                  label: "Customer Users"
                }
              }
            }
          }
        end
      end
    end
  end
end

```

---

_[View the full topic](https://meta.discourse.org/t/json-schema-type-objects/405376)._
