Skip to main content

REST API Common Controller

Project description

This module uses OCAs REST API modules for creating endpoints based on a common controller called /api/. It allows you to expand all the different API endpoints from this particular controller.

Table of contents

Configuration

No configuration needed for this module.

Usage

To use this module it just needs to be installed and (from your own module) use this controller directly from your services. Like so:

# -*- coding: utf-8 -*-
from odoo.addons.component.core import Component


class YourServiceAPI(Component):
    _name = "your.model.api"
    _inherit = "base.rest.service"
    _usage = "yourEndpoint"
    _default_auth = "api_key"
    _collection = (
        "api_common_base.services"  #  <-- that's where you'd use this module as a base
    )
    _description = """
    Description of your endpoint
    """

    def get(self): ...

After that you will see your endpoint available at the route: {odoo_base_url}/api/yourEndpoint/get

Also, the class APICommonBaseRestCase from tests/common_service.py can be inherited in API tests classes from dependent modules in order to use its basic common setup API methods (http_get, http_post, http_get_content).

Known issues / Roadmap

There are no known issues for this module.

Bug Tracker

Bugs are tracked on GitLab Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • SomIT SCCL

  • Som Connexio SCCL

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odoo-addon-api_common_base-16.0.1.0.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

odoo_addon_api_common_base-16.0.1.0.0-py2.py3-none-any.whl (24.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file odoo-addon-api_common_base-16.0.1.0.0.tar.gz.

File metadata

File hashes

Hashes for odoo-addon-api_common_base-16.0.1.0.0.tar.gz
Algorithm Hash digest
SHA256 fae68c9511c877292c91886eeafd92975bbed044a5187f17ab4667554f7374ee
MD5 3724ed088472efce2c13b2dd69ccc769
BLAKE2b-256 6116caebda5e022653855d762be365a87bfb0013ad7bed57cf99eb529f3a96c9

See more details on using hashes here.

File details

Details for the file odoo_addon_api_common_base-16.0.1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_api_common_base-16.0.1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 06a563332acb45671c8ea7feca5ab94f9226df117966123056369c1b8adf8e95
MD5 8ab05d2107dc75f1a6fab2f6c9082d41
BLAKE2b-256 4adb8019671227822d71a51bcbe5f2bd63d81aeeb5fc681f22fd4bfa7a692840

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page