base_rest
This addon provides the basis to develop high level REST APIs for Odoo.
Key Features
- REST API: Enables development of high-level REST APIs for Odoo to facilitate integration with external systems.
- OpenAPI: Generates OpenAPI documentation from source code for API specification.
- Swagger UI: Serves Swagger UI interface at /api-docs for interactive API documentation.
- Development mode: Supports configurable development mode to return detailed error information for debugging.
- Service components: Allows implementation of business logic through components inheriting from base.rest.service.
- Controllers: Registers REST services via controllers inheriting from RestController with defined root paths.
- HTTP methods: Supports standard HTTP methods (GET, POST, PUT, DELETE) with conventional routing for CRUD operations.
- Data validation: Provides input and output validation using Cerberus schemas for data integrity.
- Decorator API: Offers a new decorator-based API for explicit method exposure and custom route definition.
- Datamodel support: Enables use of Datamodel objects for structured parameters and responses in services.
- Context providers: Supplies service context including authenticated_partner_id for user-specific operations.
- OAuth2 security: Supports OAuth2 security scheme integration in Swagger UI for authentication.
- Record rules: Makes authenticated_partner_id available in record rule evaluation context.