TopLogic - the automated application engine
  • Releases
  • Dokumentation
  • Github
  • Discord
  1. Home
  2. Releases
  3. TL_7.11.0
  4. #29084

7.11.0
TopLogic Release

2026-06-19

enhancement

major
#29084
JSON Schema Support for Typed Configuration
minor
#29334
Status code as argument for responses in REST requests

defect

major
#28993
Filters of dynamic columns ignore the attribute type
#29042
Error in column filter for double values
#29234
OpenAPI server cannot return binary responses
#29325
Generated JSON schema marks a non-nullable layout-template property (dialog title) as nullable/optional
#29336
7.10: Bookmark links do not work for logged-in users
#29338
CreateTLSingletonProcessor creates duplicate annotations
minor
#28456
Reference to missing files in subsession.jsp
#28485
Immutable/Disbled Boolean fields accessible/focusable via tab
#28651
Unnecessary space for inline tables
#28725
Pointless scroll bar in the help editor
#29053
TL-Script: format() with null input returns IllegalArgumentException
#29066
"SafeHTML not started" error with scripted tests
#29069
A calculated attribute of the type "General search expression" cannot return a closure
#29074
The form data of a component cannot be accessed in a value transformation of a component channel
#29075
After changing the model, calculated attributes that have become invalid can no longer be edited
#29076
API key in REST interface configuration is not hidden
#29091
Values of a composition attribute cannot be edited if previously used in the same form
#29240
Update possible with incorrect attributes
#29284
Flow diagram: Font metric does not fit - texts flow beyond their frame
#29304
Replacement value attribute is not applied correctly in transient objects
#29339
Failed migration in #28305
#29340
TL Script: Optimizing database queries with transient objects fails
enhancement

major

#29084

JSON Schema Support for Typed Configuration

JSONTypedConfiguration

Summary

Enhance the JSON serialization and deserialization of typed configurations with JSON Schema support according to the JSON Schema 2020-12 specification. This enables schema validation of configuration JSON documents and improves interoperability with external tools that support JSON Schema.

Background

TopLogic's typed configuration system uses Java interfaces with annotations to describe configuration structures. While XML has been the primary serialization format, JSON support was added for scenarios requiring JSON data exchange. However, the existing JSON format lacked a formal schema definition that could be used for validation or documentation purposes.

Implementation

1 JSON Schema Model

A complete object model for JSON Schema 2020-12 has been implemented in com.top_logic.basic.json.schema.model using msgbuf-generated data classes:

  • Schema base types: Schema, JsonSchema, JsonSchemaDocument
  • Type schemas: ObjectSchema, ArraySchema, StringSchema, NumericSchema, BooleanSchema, NullSchema, EnumSchema, ConstSchema
  • Composition schemas: AllOfSchema, AnyOfSchema, OneOfSchema, NotSchema, ConditionalSchema
  • Reference schemas: RefSchema, DynamicRefSchema
  • Boolean schemas: TrueSchema, FalseSchema

Serialization is handled by JsonSchemaWriter / JsonSchemaSerializer and parsing by JsonSchemaParser.

2. schema builder

The JsonConfigSchemaBuilder derives JSON schemas from ConfigurationDescriptor instances by:

  • Mapping property types: Primitive types to appropriate JSON schema types (string, number, integer, boolean)
  • Handling nested configurations: ITEM properties become object schemas with type references
  • Supporting polymorphism: Sub-types are combined using anyOf schemas
  • Modeling inheritance: Super-type properties are composed using allOf schemas
  • Translating constraints: Annotations like @Bound, @NonNegative, @Positive, @NonPositive, @Negative become minimum/`maximum` constraints
  • Including metadata: I18N labels and descriptions from resources are added as title and description
  • Handling enums: Enum constants are translated to enum schemas, respecting ExternallyNamed and ProtocolEnum, with documentation for each constant
  • Handling maps: propertyNames constraints enforce key types for map properties, including enum and integer key types
  • @Key annotation support: Properties annotated with @Key are modeled correctly, including polymorphic type hierarchies with keyed entries
  • Root schema hoisting: The root schema is placed at the top level of the document with other type schemas in $defs
  • External schema resolution: A SchemaResolver interface enables controlling how external/pre-defined schemas are referenced rather than inlined
  • Custom type identifiers: A resolveTypeId() hook allows custom type identifier generation (e.g., for dynamic descriptors)
  • @JsonBinding schema support: Properties with custom @JsonBinding annotations delegate schema generation to the binding's buildSchema() method

The schema uses a $type property to identify the concrete configuration or implementation type.

3 Schema-Aware Serialization

The JsonConfigurationWriter is enhanced with a schemaAware() mode that produces schema-conformant JSON:

  • Type annotations are written as a $type property within the object (not as array wrapper)
  • Implementation classes are referenced directly for PolymorphicConfiguration properties
  • The format is designed for static validation against the generated schema
  • A resolveTypeId() hook enables custom type identifiers in the serialized output
4 Schema-Aware Deserialization

The JsonConfigurationReader is enhanced with a corresponding schemaAware() mode:

  • Reads the $type property to determine the concrete configuration type
  • Supports both configuration interface types and implementation class references
  • Maintains backwards compatibility with the stream-optimized format
5. @Final Annotation

A new @Final annotation for configuration interfaces marks types that have no sub-types. This allows the schema builder and serializer to omit the $type property when the configuration type is unambiguous, producing cleaner schemas and JSON. OpenAPI document interfaces were annotated as a first use case.

6 JsonBinding Framework

The @JsonBinding annotation (type and method level) associates configuration types with custom JsonValueBinding<T> implementations. Each binding provides:

  • loadConfigItem() / saveConfigItem() for JSON serialization
  • buildSchema() for JSON schema generation
  • ConfigurationValueCheck methods for validation

Binding implementations:

  • ResKeyJsonBinding - Resource keys serialized as JSON objects with language-keyed fields; literal ResKeys supported
  • StringArrayJsonBinding - String arrays
  • BinaryDataJsonBinding - Binary data serialized as base64-encoded objects with name and contentType metadata
  • HtmlResKeyJsonBinding - HTML resource keys
  • StructuredTextJsonBinding - Structured text values
  • I18NStructuredTextJsonBinding - Internationalized structured text values
7. descriptor enhancement

ConfigurationDescriptor is extended with:

  • getInstanceType(): Returns the implementation type A` if the configuration is a `PolymorphicConfiguration<A>, enabling proper schema generation for configured instances.

Schema Structure

For a configuration type A` with sub-types `B1, B2:

value-schema(A) := anyOf( allOf(required-type-ref(A), properties(A)), // if A is non-abstract ref:value-schema(B1), ref:value-schema(B2) ) properties(A) := allOf( local-properties(A), ref:properties(SuperType1), ... )

The root schema is hoisted to the top level of the JsonSchemaDocument, with all other type schemas placed in $defs and referenced via $ref.

Testing

  • TestJsonConfigurationWithSchema - Comprehensive round-trip tests for schema-aware serialization: polymorphic base values, abstract types with multiple sub-types, configured implementations, and inheritance hierarchies
  • TestJsonConfigSchemaBuilderEnums - Enum handling including ExternallyNamed and ProtocolEnum
  • TestJsonConfigSchemaBuilderKeyAnnotation - @Key annotation support with polymorphic types and enum/integer map keys
  • TestJsonSchemaParser / TestJsonSchemaSerializer - Unit tests for schema model parsing and serialization
  • Schema-aware vs. non-schema-aware serialization comparison tests
  • OpenAPI JSON binding round-trip tests
  • Tests for all JsonBinding implementations (BinaryData, HtmlResKey, StructuredText, I18NStructuredText)
  • Round-trip serialization with schema validation using the networknt/json-schema-validator library (test scope)

Use Cases

  1. External Tool Integration: Generated schemas can be used by IDE plugins, API documentation tools, or configuration editors
  2. Validation: Configuration JSON can be validated before processing
  3. Documentation: Schemas serve as machine-readable API documentation with I18N labels and descriptions
  4. Code Generation: External tools can generate client code from schemas
  • Get Started
  • Github
  • Discord
  • Das Unternehmen hinter TopLogic
  • Softwareentwicklung heute
  • Kontakt

© Copyright – Business Operation Systems GmbH

  • top-logic.com
  • Nutzungsbedingungen
  • Impressum
  • Rechtlicher Hinweis
  • Datenschutz
  • DE
  • Login