Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Extra Tools
  3. Custom API Swagger UI v 14.0
  4. Sales Conditions FAQ

Custom API Swagger UI

by Kitworks Systems https://kitworks.systems/
Odoo
v 14.0 Third Party 3
Download for v 14.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Community Apps Dependencies Show
• Custom API controller
• Kitworks API
• Generic Mixin
• Mixins
Lines of code 4766
Technical Name kw_api_swagger
LicenseLGPL-3
Websitehttps://kitworks.systems/
Versions 14.0 15.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Community Apps Dependencies Show
• Custom API controller
• Kitworks API
• Generic Mixin
• Mixins
Lines of code 4766
Technical Name kw_api_swagger
LicenseLGPL-3
Websitehttps://kitworks.systems/
Versions 14.0 15.0

KW API Swagger

Provides interactive Swagger UI and auto-generated OpenAPI 3.0 documentation for KW API Custom Endpoints.

  • Overview
  • Features
  • Dependencies
    • Required Modules
    • External Dependencies
  • Installation
  • Usage
    • Accessing Swagger UI
    • Available Endpoints
    • Testing Endpoints
  • Technical Details
    • Architecture
    • Routes
    • How It Works
    • Field Type Mappings
  • Configuration
  • Known Limitations
  • Troubleshooting

Overview

This module adds Swagger/OpenAPI documentation capabilities to kw_api_custom_endpoint. It automatically generates interactive API documentation from your custom endpoint configurations, making it easy to explore, test, and understand your API without manual documentation.

Features

  • Auto-generated OpenAPI 3.0 Specification - No manual spec writing required
  • Interactive Swagger UI - Test endpoints directly from the browser
  • Dynamic Schema Generation - Automatically infers schemas from Odoo model fields
  • Field Type Mapping - Supports all Odoo field types (char, integer, many2one, one2many, etc.)
  • Authentication Support - Documents API key and bearer token authentication
  • CRUD Endpoint Documentation - Covers list, get, create, update, delete operations
  • Real-time Updates - Swagger spec updates when endpoints are modified

Dependencies

Required Modules

  • kw_api_custom_endpoint - Provides the core custom endpoint functionality

External Dependencies

  • Swagger UI (loaded via CDN) - No local installation required

Installation

  1. Ensure kw_api_custom_endpoint is installed and configured

  2. Install kw_api_swagger module:

    odoo-bin -d your_database -i kw_api_swagger
    
  3. No additional configuration required

Usage

Accessing Swagger UI

Via Menu:

Navigate to: KW API � Swagger

Via URL:

Browse to: https://your-odoo-instance.com/kw_api/swagger/

OpenAPI Spec:

JSON endpoint: https://your-odoo-instance.com/kw_api/swagger/swagger.json

Available Endpoints

The Swagger UI automatically documents:

  • Authentication Endpoints
    • POST /kw_api/auth/token - Get access token
    • POST /kw_api/auth/is_token_alive - Validate token
  • Custom CRUD Endpoints
    • GET /kw_api/custom/{api_name} - List records
    • GET /kw_api/custom/{api_name}/{id} - Get single record
    • POST /kw_api/custom/{api_name} - Create record
    • POST /kw_api/custom/{api_name}/{id} - Update record
    • DELETE /kw_api/custom/{api_name}/{id} - Delete record

Testing Endpoints

  1. Open Swagger UI from the menu
  2. Click on an endpoint to expand details
  3. Click "Try it out"
  4. Fill in required parameters
  5. Add authentication headers if required
  6. Click "Execute" to test the endpoint
  7. View response below

Technical Details

Architecture

  • Controller Inheritance: SwaggerController extends CustomEndpointController
  • No Data Layer: Uses models from kw_api_custom_endpoint
  • View Integration: Template inherits from web.report_layout

Routes

GET  /kw_api/swagger/              - Swagger UI interface (auth='user')
GET  /kw_api/swagger/swagger.json  - OpenAPI specification (auth='user')

How It Works

  1. Queries all configured kw.api.custom.endpoint records
  2. Generates OpenAPI paths for enabled operations (list, get, create, update, delete)
  3. Inspects ir.model.fields to build request/response schemas
  4. Maps Odoo field types to OpenAPI data types
  5. Serves JSON spec to Swagger UI for rendering

Field Type Mappings

Odoo Type OpenAPI Type Example
char string "example text"
text string "long text"
integer integer 123
float number 123.45
boolean boolean true
date string(date) "2024-12-31"
datetime string "2024-12-31T23:59:59Z"
many2one integer 123
selection string "value"
one2many array [{...}]
many2many array [{...}]

Configuration

This module requires no configuration. Swagger documentation is automatically generated based on your custom endpoint configurations in kw_api_custom_endpoint.

Authentication: Swagger UI requires Odoo user authentication (auth='user'). Ensure users have appropriate access rights to the KW API menu.

Known Limitations

  • Custom response functions show "contact administrator" message (cannot introspect)
  • Requires active user session (not public access)
  • Depends on endpoints being configured in kw_api_custom_endpoint

Troubleshooting

Swagger UI not loading:

  • Check browser console for JavaScript errors
  • Verify swagger-ui.js is accessible at /kw_api_swagger/static/js/swagger-ui.js
  • Clear browser cache

Endpoints missing from Swagger:

  • Ensure endpoints are enabled in kw_api_custom_endpoint
  • Check that operations (list/get/create/update/delete) are activated
  • Refresh the page to regenerate the spec

Schema showing incorrect types:

  • Verify field definitions in the related Odoo model
  • Check ir.model.fields for correct field type (ttype)

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with