Skip to content

DATAAPI-37: support custom endpoints#90

Merged
DominicWatson merged 4 commits intostablefrom
feature-DATAAPI-37_support_custom_endpoints
Jun 24, 2025
Merged

DATAAPI-37: support custom endpoints#90
DominicWatson merged 4 commits intostablefrom
feature-DATAAPI-37_support_custom_endpoints

Conversation

@jjannek
Copy link
Collaborator

@jjannek jjannek commented Feb 12, 2025

Currently custom endpoints that are mixed into a data api only work on namespaced APIs, not on the default one (/data/v1). This is solved when explicitly checking for the full api handlers on rest request.

Examples:
/data/v1/entity/contact request will resolve to the handler data.v1.WholeEntity
/mycustomapi/v1/entity/contact request will also resolve to the handler data.v1.WholeEntity
/mycustomapi/v1/test/ will have a handler detected as mycustomapi.v1.test, therefore not being picked up by the Data API Service

But
/data/v1/test/ will have a handler detected as data.v1.test, being picked up by DataApiService and therefore leads to a 404

var dataApiRoutes = dataApiConfigurationService.getDataApiRoutes();
for( var apiRoute in dataApiRoutes ) {
if ( api == apiRoute && reFindNoCase( "^data\.v1", resource.handler ?: "" ) ) {
if ( api == apiRoute && reFindNoCase( regex, resource.handler ?: "" ) ) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check on namespaced APIs is not necessarily required, because the resource handler differs anyway. I have just added it here to be consistent with the default API.

@DominicWatson DominicWatson merged commit a178ecf into stable Jun 24, 2025
3 of 4 checks passed
@DominicWatson DominicWatson deleted the feature-DATAAPI-37_support_custom_endpoints branch June 24, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants