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

7.11.0
TopLogic Release

2026-06-19

enhancement

major
#29084
JSON Schema Support for Typed Configuration
minor
#29334
Statuscode als Argument bei Antworten in REST-Anfragen

defect

major
#28993
Filter von dynamischen Spalten ignorieren den Attributtyp
#29042
Fehler in Spaltenfilter nach Double-Werten
#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 funktionieren bei eingeloggten Nutzern nicht
#29338
CreateTLSingletonProcessor legt doppelte Annotation an
minor
#28456
Referenz auf fehlende Dateien in subsession.jsp
#28485
Immutable/Disbled Booleanfelder über Tab erreichbar/fokusierbar
#28651
Unnötiger Platz bei Inline-Tabellen
#28725
Sinnlose Scroll-Bar im Hilfe-Editor
#29053
TL-Script: format() mit null input liefert IllegalArgumentException
#29066
"SafeHTML not started" Fehler bei scripted Tests
#29069
Ein berechnetes Attribut vom Typ "Allg. Suchausdruck" kann keine Closure zurückgeben
#29074
In einer Wertetransformation eines Komponentenkanals kann nicht auf die Formulardaten einer Komponente zugegriffen werden
#29075
Nach Modell-Änderung können invalide gewordene berechnete Attribute nicht mehr editiert werden
#29076
API-Key in REST-Schnittstellenkonfiguration wird nicht verborgen
#29091
Werte eines Kompositionsattribut nicht bearbeitbar, wenn im gleichen Formular vorher verwendet
#29240
Update mit falschem Attribute möglich
#29284
Flow-Diagram: Font-Metrik passt nicht - Texte fließen über ihren Rahmen hinaus
#29304
Ersatzwert-Attribut wird in transienten Objekten nicht korrekt übernommen
#29339
Fehlerhafte Migration in #28305
#29340
TL-Script: Optimierung von Datenbankabfragen mit transienten Objekte schlägt fehl
defect

major

#29234

OpenAPI server cannot return binary responses

OpenAPI

Problem

The current server-side OpenAPI implementation does not allow defining an endpoint that returns binary data. Any operation result is either JSON-serialized or coerced to a String before being written to the HTTP response — there is no path for streaming raw bytes (e.g. application/octet-stream, image/*, application/pdf) to the caller.

Root Cause

In com.top_logic.service.openapi.server.impl.ServiceMethodByExpression#handleRequest, the response body is always written via the character Writer:

{{{#!java resp.getWriter().write(content); // content is always a String }}}

The value of content is built in exactly two ways:

  • Default (no Response wrapper): content = JSON.toString(result) — any return value is JSON-serialized.
  • With Response wrapper (HTTPResponse TL-Script function): if the MIME type is application/json, then content = JSON.toString(response.getResult()); otherwise content = String.valueOf(response.getResult()).

HttpServletResponse#getOutputStream() is never used for user endpoint responses. There is no special-casing for BinaryData, byte[], or InputStream return values — they fall into the else branch and are either JSON-serialized or coerced via String.valueOf(...), which destroys the binary content.

The Javadoc of com.top_logic.service.openapi.server.impl.Response already documents this limitation:

> "written to HttpServletResponse#getWriter()" — i.e., character output only.

Schema vs. Runtime Mismatch

com.top_logic.service.openapi.server.parameter.ParameterFormat defines a BINARY entry, which is reused by OperationResponse#getFormat(). BINARY is emitted into the generated OpenAPI spec document as a schema annotation, but there is no corresponding runtime handling in the response writer. The published contract therefore lies about what the endpoint can actually deliver.

Asymmetry with the Client Side

The client side (consuming a remote API) does support binary responses: com.top_logic.service.openapi.client.registry.impl.response.ResponseHandlerByExpression calls EntityUtils.toByteArray(entity) for BINARY format and returns a byte[] to TL-Script. Only the server side (producing a response) is broken.

Proposed Fix

In ServiceMethodByExpression#handleRequest, branch on the result type:

  • If the result is a BinaryData, byte[], or InputStream (or if the declared/response ParameterFormat is BINARY), write raw bytes via resp.getOutputStream() instead of resp.getWriter().
  • Preserve the current JSON/string path for all other cases.

Additionally, Response (the HTTPResponse TL-Script wrapper) should accept binary payloads so that a script can explicitly return application/octet-stream, application/pdf, image/*, etc., with the correct Content-Type and Content-Length set.

Affected Files

  • com.top_logic.service.openapi.server/src/main/java/com/top_logic/service/openapi/server/impl/ServiceMethodByExpression.java (lines 79–112)
  • com.top_logic.service.openapi.server/src/main/java/com/top_logic/service/openapi/server/impl/Response.java (Javadoc + possibly new binary payload field)
  • com.top_logic.service.openapi.server/src/main/java/com/top_logic/service/openapi/server/parameter/ParameterFormat.java (runtime hook for BINARY on the response side)
  • Get Started
  • Github
  • Discord
  • Das Unternehmen hinter TopLogic
  • Softwareentwicklung heute
  • Kontakt

© Copyright – Business Operation Systems GmbH

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