HTTPApi how to return complex types

Hi,

I’m experimenting with HTTPApi and have got a handle on the basic concepts but am having trouble with returning a complex type from a function.

I’ve inherited my class from TROComplexType and then declared my function thus:

[ROServiceMethod]
[ROCustom(‘HttpApiPath’,‘getcustomer/{accountref}’)]
[ROCustom(‘HttpApiMethod’,‘GET’)]
function GetCustomer(accountref : string) : CustomerDetails;

When I look at the generated ‘swagger’ api, I see this:

/getcustomer/{accountref}: {
get: {
parameters: [
{
name: “accountref”,
in: “path”,
required: true,
type: “string”
}
],
responses: {
200: {
description: “The method call completed successfully”,
schema: {
$ref: “#/definitions/CustomerDetails”
}
},
400: {
description: “Bad Request”
},
500: {
description: “Internal Server Error”
}
}
}
}

Then, down the bottom, I see:

definitions: {
CustomerDetails: {
type: “object”,
properties: { }
}
}

It seems that it’s not including the actual definition of my type. Could you shed some light on what I’m doing wrong here?

Thanks.

Ignore me, I’m an idiot.

I had my class properties as public rather than published, seems to work fine now.

Apologies.