sgcOpenAPI 2026.10.0 Latest
- 2026.10.0: 2026 October
- NewThe OpenAPI Parser wizard now searches the description as well when you filter the list of parsed methods, not only the name and the endpoint. Typing deprecated lists just the operations the document marks as deprecated, and the None button then unticks all of them at once, because the buttons only act on the rows the filter is showing.
- NewTsgcOpenAPI_Client: new property UserAgent to set the User-Agent header sent with every request, set it to an empty string to omit the header.
- NewCode-First: new sgcOperationId attribute to give a method its own operationId, so two controllers can each have a method with the same name, for example ListTasks in the /api/v1 and in the /api/v2 controller. New GenerateSpec overload that builds one specification from several controller classes, when they use different class routes every path carries its own route.
- NewCode-First: TDateTime, TDate and TTime are now published as a string with format date-time, date and time, TBytes as a string with format byte (base64), an enum as a named schema that lists its values and a dynamic array as an array with its items. The server reads and writes the JSON in those same formats.
- NewCode-First: new TsgcOpenAPICodeFirstNaming class to choose the names published in the specification and used in the JSON, so a Delphi class TPublicKeyCertificate can be published as PublicKeyCertificate, a property PublicKeyId as publicKeyId and an enum value pkuKsefTokenEncryption as KsefTokenEncryption. Assign the same instance to the Naming property of the scanner and of the dispatcher (none by default, the Delphi names are used).
- NewCode-First: new GenerateSpec overload that takes the dispatcher and builds the specification from every controller registered with RegisterController, in the order they were registered, so the list of controllers lives in one place. The new GetControllerClasses method of the dispatcher returns those classes.
- NewCode-First: a method can now document several responses with one sgcResponse attribute each, including error responses that publish their own class as the body, for example [sgcResponse(400, 'Bad request', TErrorResponse)]. New sgcExample attribute to add an example value to a property, or an example body to a response of a method.
- NewCode-First: a method can now answer with an error response and its own body by raising EsgcOpenAPIResponseException with the status code and the object to send, for example raise EsgcOpenAPIResponseException.Create(429, oTooManyRequests). The object is sent as JSON like a return value and freed by the exception. A method that already answered through the request context, with RespondJSON or RespondError, is no longer overwritten by its return value, which is freed instead.
- NewCode-First: sgcResponse can now declare that the body is an array of the class, for example [sgcResponse(200, 'OK', TPublicKeyCertificate, True)], and the media type of the response, for example [sgcResponse(429, 'Too Many Requests', TTooManyRequestsResponse, 'application/problem+json')]. The media type is used in the specification and is also sent as the Content-Type header when the server answers with that status code.
- FixedFixed Bug OpenAPI Parser: a request body declared as an array of objects generated a method that took a single object, so only one item could ever be sent. It now generates an array class and the method takes the whole list. Regenerate the unit to pick it up, the signature of those methods changes.
- FixedFixed Bug Code-First: two controllers with different class routes could not serve the same method route, for example GET /tasks under /api/v1 and under /api/v2, because the check for duplicated endpoints ignored the class route.
- FixedFixed Bug Code-First: the JSON of a request or response body only carried the published properties although the specification also listed the public ones, a date was sent as a number, a dynamic array was left out and a method returning an enum answered its number instead of its name. A TBytes property was published as an array with no items, which is not a valid specification.
- FixedFixed Bug Code-First: a method with a custom success code, for example [sgcResponse(201, 'Created')], lost the schema of its return type in the generated specification although the server still sent the body.
- FixedFixed Bug OpenAPI Server: the JSON responses were sent with the content type application/json without a charset, so the server wrote the body in ISO-8859-1 and every character outside Latin-1, for example the Polish letters of "Zazolc gesla jazn", arrived as "?". The JSON responses, the specification and the Swagger UI page are now sent as UTF-8 with charset=utf-8 in the Content-Type header.