Skip to content

Custom Types Serializer are broken #182

@wiphi

Description

@wiphi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedIssue has been accepted and inserted in a future milestonebug

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions