Management API MCP server throws ContentTypeMapper.ExtractFormComponent error

Hi all

We're using the Kentico Xperience Management API (NuGet: Kentico.Xperience.ManagementApi, preview) and calling:

GET /kentico-api/management/v1/content-types

The request fails with:

System.NullReferenceException: Object reference not set to an instance of an object.

   at Kentico.Xperience.ManagementApi.ContentTypeMapper.ExtractFormComponent(FormFieldInfo fieldInfo)

   at Kentico.Xperience.ManagementApi.ContentTypeMapper.ToFormField(FormFieldInfo formField)

   at Kentico.Xperience.ManagementApi.ContentTypeMapper.ToContentTypeFormItem(IDataDefinitionItem item)

   ...

   at Kentico.Xperience.ManagementApi.ContentTypeService.GetContentTypes(GetParameters getParameters, CancellationToken cancellationToken)

   at Kentico.Xperience.ManagementApi.Internal.ContentTypeController.Get(String cursor, Nullable\`1 limit, CancellationToken cancellationToken)

We're on Xperience by Kentico 31.1.2 (using Management API package 31.1.2-preview).

Other Management API endpoints we tried (e.g. list form components, list data types, list reusable schemas) work. Only the content-types list fails.

Could this be caused by some kind of corruption in our content type or form definitions? Has anyone else seen this before?

Thanks in advance!

Tags:
KentiCopilot v31.1.0
0

Answers

Accepted answer

Never mind! I found the issue after some debugging. Posting the answer here in case anyone else runs into this.

Our content types use custom UI form components from a separate class library. For some reason that project reference was removed, so the web project wasn't referencing that assembly. After adding the project reference from the web app to the assembly that contains those custom form components, the content-types API started working again.

0

To response this discussion, you have to login first.