romaricdrigon/MetaYaml

Prototype with choices - impossible?

Closed this issue · 3 comments

I cannot declare a schema with prototype of choices.

              'process' => [ '_type' => 'prototype', '_required' => TRUE, '_min_items' => 1, '_prototype' => [
                '_type' => '_choice', '_required' => TRUE, '_choices' => [
                  0 => [ '_type' => 'array', '_required' => FALSE, '_ignore_extra_keys' => TRUE, '_children' => [
                    'plugin' => [ '_type' => 'text',  '_required' => TRUE ],
                  ]],
                  1 => [ '_type' => 'prototype', '_required' => FALSE, '_min_items' => 1, '_prototype' => [
                    '_type' => 'array', '_required' => FALSE, '_ignore_extra_keys' => TRUE, '_children' => [
                      'plugin' => [ '_type' => 'text',  '_required' => TRUE ],
                    ]
                  ]],
                ]
              ]],

Is this is a documented limitation or a bug?

Omg, '_type' => '_choice' should be '_type' => 'choice'

Hello @OnkelTem ,
I was on holidays last week, without my computer nor even mobile network.
I'm glad you found the solution!