OdooTools OpenAPI
This package is a library and an a plugin for odoo-tools.
When used as a library, it define an orm that helps unwrap json body into python objects and Odoo objects back into JSON.
When used as a command, it will generate an Odoo Module with api models and controllers as defined in an openapi3 spec with custom extensions for Odoo.
The command can be invoked as such:
odootools gen openapi --destination my_module_api --path path_to_spec
odootools gen openapi --destination my_module_api --url url_to_spec
Then the module will be created inside the destination path. It will use the title/description of the api to define the name/summary of the module.
Example API:
openapi: 3.0.0
info:
contact:
email: info@odoo.plus
name: Loïc Faure-Lacroix
url: https://www.odoo.plus
description: ''
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
title: ''
version: '1'
tags:
- name: projects
description: Super projects
components:
schemas:
ApiResult:
description: Api Result
properties:
id:
title: Resource Id
type: integer
type: object
Project:
description: Project
x-model: project.project
properties:
id:
title: ID
type: integer
name:
title: Name
type: string
paths:
/project/{project}:
get:
tags:
- projects
parameters:
- name: project
x-model:
$ref: "#/components/schemas/Project"
in: path
required: true
schema:
type: integer
description: Get a project
operationId: get_project
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResult'
description: Project
Result controller:
from odootools_openapi.odoo.http import request, route, Controller
from ..api_models.apiresult import ApiResult
class Projects(Controller):
"""
Super projects
"""
@route(
route=["/project/<model('project.project'):project>"],
methods=['GET'],
csrf=False,
type='plainjson',
auth='none',
)
def get_project(self, project):
"""
Get a project
"""
pass
Metadata
Release files for odootools-openapi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| odootools-openapi-0.1.0.tar.gz | 15.9 kB | Without provenance | Details for odootools-openapi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| odootools_openapi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for odootools_openapi-0.1.0-py3-none-any.whl |
Total release size: 36.4 kB
Release files / odootools-openapi-0.1.0.tar.gz
| Download URL | odootools-openapi-0.1.0.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5c067c8e7c79627736701ed4ad678cbcf573c45ed4be0f81324af9f1bef744d
|
|
BLAKE2b-256 checksum How to use checksums |
a1a5b8a2ffcaabf0796527ccd6a2af49c0e88ff153e83b8c7424201763a254ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / odootools_openapi-0.1.0-py3-none-any.whl
| Download URL | odootools_openapi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc4ac26df3da5298ca92434d29a19ad9649fef3233995458e3b091db8a1c79d9
|
|
BLAKE2b-256 checksum How to use checksums |
c3036784350721eb2fc92d9fe67340358acdb04f4fe5cf2c6635d494f824e1dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for odootools-openapi 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.