Skip to content

[feature] Allow partial custom API view modules #1457

Description

@nemesifier

Is your feature request related to a problem? Please describe.

This feature request is inspired by the work done in openwisp-users issue #553 and its reference implementation in PR #554.

The Config, Connection, and PKI API URL helpers require custom views modules to define every callback. An extension that customizes one API view must duplicate the remaining callbacks, and new upstream routes can break the custom module during URL configuration.

Describe the solution you'd like

Allow config.api.urls.get_api_urls(), connection.api.urls.get_api_urls(), and pki.api.urls.get_pki_api_urls() to use the matching callback from a supplied module when it exists and fall back to their standard views otherwise. The helpers should preserve current paths, names, namespaces, and default behavior.

Add focused regression coverage for supplied callbacks and omitted-callback fallbacks across all three API groups, then document partial API view overrides in the extension guide.

Describe alternatives you've considered

Custom applications can continue duplicating every callback alias from the standard modules, but that creates unnecessary boilerplate and couples them to the complete upstream callback sets.

Additional context

This would also benefit projects, such as Firmware Upgrader, that customize Controller connection API views.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    To do
    Status
    To do (Python & Django)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions