Search 1.9 billion lines of Odoo code on GitHub

openapi

Author: IT-Projects LLC, Ivan Yelizariev
License: LGPL-3
Branch: 13.0
Repository: elblasy33/sync-addons
Dependencies: base, and mail
Languages: HTML (336, 12.6%), JavaScript (29, 1.1%), Python (1788, 66.9%), XML (387, 14.5%), and reStructuredText (133, 5.0%)
Other branches: 10.0, 11.0, and 12.0
Other repositories: DITIntl/sync-addons, ERPymes/ERPymes, Jeisonpernia/sync-addons, Kiplangatdan/sync-addons, NigmatullinAN/sync-addons, OpenAT/online, Posland/sync-addons, Raniani-lab/sync-addons, SeuMarco/sync-addons, TestMergeBot/sync-addons, WithPrice/sync-addons, ajinvn2019/sync-addons, akshaynesm/sync-addons, aschenkels-ictstudio/sync-addons, brain-tec/mail-addons, brain-tec/sync-addons, code-pack/sync-addons, dingguijin/sync-addons, em230418/sync-addons, flectra-hq/flectra, hinfo506/sync-addons, huntergps/sync-addons, itpp-labs/sync-addons, kevinpthorne/flectra, malakhA/sync-addons, marcelsavegnago/sync-addons, mausvt/flectra, molandtoxx/sync-addons, sinandurgut07/sync-addons, sisboca/sync-addons, trojikman/sync-addons, vidtsin/sync-addons, ychirino/openapi, and yelizariev/sync-addons

<a class="reference external image-reference" href="https://www.gnu.org/licenses/lgpl"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a name="rest-api-openapi-swagger"></a> <h2>REST API/OpenAPI/Swagger</h2> <p>Set up REST API and export OpenAPI (Swagger) specification file for integration with whatever system you need. All can be configured in Odoo UI, no extra module is needed.</p> <p>This module implements a <code>/api/v1/</code> route tree.</p> <a name="authentication"></a> <h3>Authentication</h3> <ul class="simple"> <li>Database inference: Database name encoded and appended to the token</li> <li>User authentication through the actual token</li> </ul> <p>As a workaround for multi-db Odoo instances, system uses <a class="reference external" href="https://swagger.io/docs/specification/2-0/authentication/basic-authentication/">Basic Authentication</a> with <code>db_name:token</code> credentials, where <code>token</code> is a new field in <code>res.users</code> model. That is, whenever you see Username / Password to setup OpenAPI connection, use Database Name / OpenAPI toekn accordingly.</p> <a name="roadmap"></a> <h3>Roadmap</h3> <ul> <li><p class="first">TODO: Rewrite tests to replace dependency <code>mail</code> to <code>web</code> module.</p> </li> <li><p class="first">TODO: check whether module works in odoo.sh and if not, document what exactly doesn't work and what a possible workarounds</p> </li> <li><p class="first">TODO: Add a smart button for Logs in <code>openapi.namespace</code> form</p> </li> <li><p class="first">TODO: Add a button to developer menu to grant access to current model</p> <blockquote> <ul class="simple"> <li><a class="reference external" href="https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html">Activate Developer Mode</a></li> <li>Open the developer tools drop down</li> <li>Click menu <code>Configure REST API</code> located within the dropdown</li> <li>On the form that opens, activate and configure this module for REST API accessability.</li> <li>Click <code>[Apply]</code></li> </ul> </blockquote> </li> <li><p class="first">TODO: when user is not authenticated api returns 200 with the message below, instead of designed 401</p> <pre> <code>File &quot;/opt/odoo/vendor/it-projects-llc/sync-addons/openapi/controllers/pinguin.py&quot;, line 152, in authenticate_token_for_user raise werkzeug.exceptions.HTTPException(response=error_response(*CODE__no_user_auth)) HTTPException: ??? Unknown Error: None</code> </pre> </li> <li><p class="first">TODO: <code>wrap__resource__create_one</code> method makes <code>cr.commit()</code>. We need to avoid that.</p> </li> <li><p class="first">TODO: add code examples for other programming languages in index.html. The examples can be based on generated swagger clients. The idea of the scripts must be the same as for python (search for partner, create if it doesn't exist, send message)</p> </li> <li><p class="first">TODO: use sudo for log creating and disable write access rights</p> </li> <li><p class="first">TODO: finish unitttests (see <code>test_api.py</code>)</p> </li> <li><p class="first">TODO: <code>.../swagger.json</code> url doesn't work in multi-db mode in odoo 12.0 at least: it make strange redirection to from <code>/api/v1/demo/swagger.json?token=demo_token&amp;db=source</code> to <code>/api/v1/demo/swagger.json?token%3Ddemo_token%26db%3Dsource</code></p> </li> </ul> <a name="credits"></a> <h3>Credits</h3> <a name="contributors"></a> <h4>Contributors</h4> <ul class="simple"> <li><a class="reference external" href="mailto:dar&#64;xoe.solutions">David Arnold</a></li> <li><a class="reference external" href="https://it-projects.info/team/yelizariev">Ivan Yelizariev</a></li> <li><a class="reference external" href="https://it-projects.info/team/RafiZz">Rafis Bikbov</a></li> <li><a class="reference external" href="https://it-projects.info/team/ufaks">Stanislav Krotov</a></li> </ul> <a name="sponsors"></a> <h4>Sponsors</h4> <ul class="simple"> <li><a class="reference external" href="https://it-projects.info">IT-Projects LLC</a></li> <li><a class="reference external" href="https://xoe.solutions">XOE Solutions</a></li> </ul> <a name="maintainers"></a> <h4>Maintainers</h4> <ul> <li><p class="first"><a class="reference external" href="https://it-projects.info">IT-Projects LLC</a></p> <blockquote> <p>To get a guaranteed support you are kindly requested to purchase the module at <a class="reference external" href="https://apps.odoo.com/apps/modules/13.0/openapi/">odoo apps store</a>.</p> <p>Thank you for understanding!</p> <p><a class="reference external" href="https://www.it-projects.info/team">IT-Projects Team</a></p> </blockquote> </li> </ul> <a name="further-information"></a> <h3>Further information</h3> <p>Demo: <a class="reference external" href="http://runbot.it-projects.info/demo/sync-addons/13.0">http://runbot.it-projects.info/demo/sync-addons/13.0</a></p> <p>HTML Description: <a class="reference external" href="https://apps.odoo.com/apps/modules/13.0/openapi/">https://apps.odoo.com/apps/modules/13.0/openapi/</a></p> <p>Usage instructions: <a class="reference external" href="doc/index.rst">doc/index.rst</a></p> <p>Changelog: <a class="reference external" href="doc/changelog.rst">doc/changelog.rst</a></p> <p>Notifications on updates: <a class="reference external" href="https://github.com/it-projects-llc/sync-addons/commits/13.0/openapi.atom">via Atom</a>, <a class="reference external" href="https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/sync-addons/commits/13.0/openapi.atom">by Email</a></p> <p>Tested on Odoo 12.0 e1aee2aac2fd2c19dfd55734b1f51aedbc0393a6</p>