Skip to content

.sessions.listSessions throws Response validation failed #34

@woodyrew

Description

@woodyrew

Usage as per listSessions

The important part:

try {
	return await cventSDK.sessions.listSessions({
		filter: `event.id eq '${cvent_event_id}'`,
	});
} catch (err) {
	if (err instanceof cventErrors.CventSDKError) {
		console.log(err.message);
		console.log(err.statusCode);
		console.log(err.body);
		console.log(err.headers);
	}
}

Errors with:

Response validation failed +0ms
200 +0ms
{
	"paging": {
		"_links": { ... },
		"limit": 100,
		"totalCount": 65,
		"currentToken": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
	},
	"data": [ ... ]
} +3ms
Headers {
	'content-type': 'application/json',
	'content-length': '13766',
	...
} +0ms

However, as you can see, the response has all of the correct data as you'd expect from the fetch. The err.body can be used via JSON.parse()

Apart from erroring, if the totalCount is greater than the limit more requests would need to be made to fetch the remaining data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions