danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Types Serializer are broken

wiphi opened this issue · comments

Version: 3.1.1-RC1
Delphi: 10.2 Tokyo

In the readme is the new registration for custom serializers descriped as
Changed! Custom Types Serializer must be registered by media-type only, without charset definition (e.g. just application/json and not application/json;charset=utf-8)

I want to add some custom type handlers, but it seems to be broken.
How to reproduce:

  • Open up the renders_spring4d_nullable sample
  • compile and run
  • open the URL localhost:8080/api/parent/1
  • Exception EMVCSerializationException will be raised

Since the registration is:

FMVC.Serializers.Items['application/json']
.RegisterTypeSerializer(typeinfo(Nullable<System.Integer>), TNullableIntegerSerializer.Create);

... the serializer do not found them.
When I backport the registration to BuildContentType('application/json', 'utf-8') it works again.

FIXED IN 3.1.1-beryllium-RC3