Skip to content

onconova.api

This module defines and configures the main Onconova API using NinjaExtraAPI, providing a secure, standards-based interface for cancer genomics and clinical research data management. It registers all core, oncology, research, and interoperability controllers, and sets up OpenAPI documentation with custom settings and license information.

api module-attribute

The main Onconova API instance, configured with custom OpenAPI documentation, authentication requirements, and registered controllers for health checks, authentication, user management, oncology, research, interoperability, terminology, and analytics. This API serves as the entry point for all RESTful endpoints related to cancer genomics and clinical research data management.

database_exception_handler(request, exc)

Source code in onconova/api.py
@api.exception_handler(IntegrityError)
def database_exception_handler(request, exc):
    return api.create_response(
        request,
        {
            "message": "The data provided violates a database constraint: "
            + str(exc.__cause__).split("\n")[
                0
            ]  # Include only the first line of the error message for clarity
        },
        status=422,
    )

terminology_exception_handler(request, exc)

Source code in onconova/api.py
@api.exception_handler(CodedConceptDoesNotExist)
def terminology_exception_handler(request, exc):
    return api.create_response(request, {"message": str(exc)}, status=422)
runner