# Kong 1.0 configuration plugin schema changes

**URL:** <https://discuss.konghq.com/t/kong-1-0-configuration-plugin-schema-changes/2756>\
**Category:** General\
**Created:** [February 4, 2019, 9:35pm UTC](https://discuss.konghq.com/t/kong-1-0-configuration-plugin-schema-changes/2756 "2019-02-04T21:35:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdevalk2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/jdevalk2/32/521_2.png) [@jdevalk2](https://discuss.konghq.com/u/jdevalk2)\
**Post date:** [February 4, 2019, 9:35pm UTC](https://discuss.konghq.com/t/kong-1-0-configuration-plugin-schema-changes/2756/1 "2019-02-04T21:35:04Z")

</div>

Trying to convert a custom plugin schema, my intent is to have an array of Routes, each having properties.

```auto
Config:
  Routes:
  - name: route1
    otherProp: prop
  - name: route2
    otherProp: prop2

```

Note that each route has properties { name, otherProp }, and there can be many Routes.

I am trying this (below). However it does not validate in Kong. It seems to have an issue with a Record in an Array structure.

Error from Kong:

nginx: [warn] [kong] plugins.lua:240 schema for plugin ‘myplugin’ is invalid: [postgres] schema violation (fields.fields: {  
elements = {  
fields = “expected an array”  
}  
})

Also note that this is just Kong validating the schema, at this point it doesnt even have data in their to validate the route against. It just doesnt like the stand-alone schema definition.

This is in my schema.lua

If I make the Record a simple type like String, there’s no validation error. So an Array of strings seems to be possible. But not an array of Structs.

Am I missing something??

…

```auto
return {
  name = "myplugin",
  fields = {
    { config = {
        type = "record",
        fields = {
          { routes = {
              type = "array",
              required = true,
              default = {},
	      elements = {
                type = "record",
				required = true,
				fields = { 
				  name = { type = "string", default = "", required = false }, 
				  otherProp = { type = "string", default = "", required = false }, 
				},
              },
            },
          },
        },
      },
    },
  },
}

```

---

<div class="post-metadata">

**Author:** ![pjachemek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/pjachemek/32/1353_2.png) [@pjachemek](https://discuss.konghq.com/u/pjachemek)\
**Post date:** [August 30, 2019, 12:14pm UTC](https://discuss.konghq.com/t/kong-1-0-configuration-plugin-schema-changes/2756/2 "2019-08-30T12:14:30Z")

</div>

Hey, is there a solution for the case described above? I faced the same problem in my project.
