major
#29325
Generated JSON schema marks a non-nullable layout-template property (dialog title) as nullable/optional
Observed while building layout-template arguments from the generated JSON schema(toplogic://schema/layout-template/{name}).
Symptom
For the template com.top_logic/dialog.template.xml, the title property is declared non-nullable with an item-default:
<property name="title" type="PolymorphicConfiguration"> <item-default/> <non-nullable/> </property>
but the generated JSON schema presents it as nullable/optional:
"title": { "title": "Title provider", "anyOf": [ { "type": "null" }, { "$ref": "toplogic://schema/config/com.top_logic.layout.component.title.TitleProvider" } ] }
Because the schema offers {"type": "null"}, a schema-driven client (here: an AI agent authoring the arguments) reads title as optional and omits it.
Consequence
When title is omitted, the non-nullable item-default resolves to a ConstantTitle$Config whose getTitle() is @Mandatory and unset. The resulting component cannot be instantiated:
Property 'com.top_logic.layout.component.title.ConstantTitle$Config.getTitle()': Property is mandatory but not set.
This error is only logged (caught in DatabaseLayoutCacheEntry.put(...), "Cannot parse layout '...'") and the layout silently fails to build - it is not surfaced to the caller.
Expected
The generated schema should reflect the contract:
- A <non-nullable/> property should not include {"type": "null"} in its anyOf (it is not optional).
- For a non-nullable item-default whose concrete default config has @Mandatory nested properties (e.g. ConstantTitle.getTitle()), the schema should surface those nested properties as required, so a client can supply a complete value rather than producing an un-instantiable default.
Notes
- Reproduced against engine 8.0.0-alpha3 via the layout-template config-schema endpoint.
- The same shape likely affects any layout-template property declared non-nullable with an item-default that carries mandatory nested fields.
- Manifested in the tl-ai agentic layout editor, where the agent omitted title and produced an un-instantiable dialog; once the error was reported back (build-time validation with an own protocol), the agent supplied a correct ConstantTitle value.