Skip to content

Commit

Permalink
Always include disabled and required
Browse files Browse the repository at this point in the history
  • Loading branch information
edhgoose committed Oct 29, 2021
1 parent 3f947b0 commit d48b67c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Limenius/Liform/Transformer/CompoundTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function transform(FormInterface $form, array $extensions = [], $widget =
$data = [];
$order = 1;
$required = [];
$disabled = [];

foreach ($form->all() as $name => $field) {
$transformerData = $this->resolver->resolve($field);
Expand All @@ -70,16 +71,10 @@ public function transform(FormInterface $form, array $extensions = [], $widget =
'title' => $form->getConfig()->getOption('label'),
'type' => 'object',
'properties' => $data,
'required' => $required,
'disabled' => $disabled,
];

if (!empty($required)) {
$schema['required'] = $required;
}

if (!empty($disabled)) {
$schema['disabled'] = $disabled;
}

$innerType = $form->getConfig()->getType()->getInnerType();

$schema = $this->addCommonSpecs($form, $schema, $extensions, $widget);
Expand Down

0 comments on commit d48b67c

Please sign in to comment.