fusio
fusio copied to clipboard
Schema qeustion: field required
How can you indicate in the diagram that the field is required? You can indicate that the field must have at least 1 chars. Does not work if field is not sent at all.
code
#[Key('ZIPcode')]
#[Description('ZIPcode')]
#[MinLength(1)]
#[MaxLength(15)]
protected ?string $zIPcode = null;
$schemaManager = new \PSX\Schema\SchemaManager();
// we read the schema from the class
$schema = $schemaManager->getSchema(\App\Model\XYZ::class);
$X = (new \PSX\Schema\SchemaTraverser())->traverse($body, $schema, new \PSX\Schema\Visitor\TypeVisitor());
Code is generate over: https://typeapi.org/generator not over site.
Hi @teunlielu currently this is not possible, in general the idea is to only describe the properties and then you can check in your app the required fields, this is also useful if you need specific error messages.