Expose Dynamic Schema in QBM CompositionApi Endpoint in IMX API wrapper

Dear Community,

I'm working with the QBM CompositionApi in a .NET Framework 4.8 project (C# 7.3). I have an endpoint defined like this:

apiBuilder.AddMethod(
  Method.Define(DELEGATIONS_USER_ENDPOINT_URL)
    .FromTable(DELEGATIONS_TABLE_NAME)
    .WithDescription(DELEGATIONS_USER_ENDPOINT_DESCRIPTION)
    .EnableRead()
    .WithParameter(PARAM_VALIDFROM, typeof(string), isInQuery: true)
    .WithParameter(PARAM_VALIDUNTIL, typeof(string), isInQuery: true)
    .WithWhereClause((qr, baseWhereClause) => { /* ... */ })
    .WithAllColumns()
  );

(Where the upper case parameters passed are intialized as constants in another place in the code.)

The issue is that the endpoint does not return a schema via the .GetSchema() method in the generated imx-api-ccc API wrapper used by our Angular Web Portal. I have seen .WithSchema() used in some examples, but I am not sure how to apply it correctly in this context or what the best practices are for building the schema dynamically. Is there a way to ensure the schema is available for the frontend developer working on the portal? The endpoint returns the schema correctly in postman, but in the web portal it results in the following error:

2025-06-18T10:35:40.295Z ERROR [main.js:62948] Error: Uncaught (in promise):
TypeError: Cannot read properties of undefined (reading 'GetSchema')
TypeError: Cannot read properties of undefined (reading 'GetSchema')


It does not necessarily have to be a dynamic schema, a static schema would also be acceptable if that is easier to implement. Any guidance or examples on how to expose the schema properly for frontend consumption would be greatly appreciated.

Thanks a lot!

Kind Regards

Nikolai

Parents
  • Hi Nikolai,

    Can you verify if your method is correctly generated into the imx-api-ccc API wrapper?

    If so, please check the call to the imx/entityschema API endpoint that occurs when the application starts. Does the return object include include your method?

  • Hi Hanno,
    Sorry for the late response, I am one of the developers working on the issue.
    I think that the method is correctly generated (snippet from TypedClient below) and the endpoint works fine, we simply can't fetch schema through GetSchema() method, although what I've noticed with other API calls is that some return static schema object also with GetSchema() method, is this something I can configure?

    export declare class PortalCccDelegationspairFilterWrapper {
        private readonly client;
        private readonly translationProvider;
        private builder;
        constructor(client: V2Client, translationProvider: any);
        private commitMethod;
        private deleteMethod;
        /** Returns the runtime schema for this method. */
        GetSchema(): EntitySchema;
        private buildBuilderIfNeeded;
        Get(parametersOptional?: portal_CCC_DelegationsPair_filter_get_args, requestOpts?: ApiRequestOptions): Promise<import("imx-qbm-dbts").ExtendedTypedEntityCollection<PortalCccDelegationspairFilter, unknown>>;
    }


    Kind regards
    Grzegorz

Reply
  • Hi Hanno,
    Sorry for the late response, I am one of the developers working on the issue.
    I think that the method is correctly generated (snippet from TypedClient below) and the endpoint works fine, we simply can't fetch schema through GetSchema() method, although what I've noticed with other API calls is that some return static schema object also with GetSchema() method, is this something I can configure?

    export declare class PortalCccDelegationspairFilterWrapper {
        private readonly client;
        private readonly translationProvider;
        private builder;
        constructor(client: V2Client, translationProvider: any);
        private commitMethod;
        private deleteMethod;
        /** Returns the runtime schema for this method. */
        GetSchema(): EntitySchema;
        private buildBuilderIfNeeded;
        Get(parametersOptional?: portal_CCC_DelegationsPair_filter_get_args, requestOpts?: ApiRequestOptions): Promise<import("imx-qbm-dbts").ExtendedTypedEntityCollection<PortalCccDelegationspairFilter, unknown>>;
    }


    Kind regards
    Grzegorz

Children
No Data