Skip to content

fix: proper NocoDB API v3 response/request format handling#14

Merged
karlspace merged 1 commit intomainfrom
feature-20260130
Mar 25, 2026
Merged

fix: proper NocoDB API v3 response/request format handling#14
karlspace merged 1 commit intomainfrom
feature-20260130

Conversation

@karlspace
Copy link
Copy Markdown
Contributor

Summary

  • Fixes Not support for API version 3 #13: NocoDB API v3 responses use fundamentally different formats than v2
  • Added ResponseAdapter and RequestAdapter classes in api_version.py for transparent v2/v3 format conversion
  • Updated all CRUD methods in client.py to use the adapters
  • All v2 behavior remains 100% unchanged (passthrough pattern)

Changes

v3 Response Format Differences Handled

Feature v2 Format v3 Format
Records list key "list" "records"
Record ID field "Id" (uppercase) "id" (lowercase)
Field data flat {"Name": "John"} wrapped {"fields": {"Name": "John"}}
Pagination pageInfo with isLastPage cursor-based next/prev

v3 Request Format Differences Handled

Operation v2 Format v3 Format
Create/Update {"Name": "John"} {"fields": {"Name": "John"}}
Delete {"Id": 42} {"id": 42}
Bulk operations [{...}, {...}] {"records": [{...}, {...}]}

Test plan

  • All 481 existing tests pass (0 failures)
  • New TestResponseAdapter unit tests (11 tests)
  • New TestRequestAdapter unit tests (9 tests)
  • New TestV3ResponseFormatHandling integration tests (7 tests)
  • v2 passthrough tests verify no regression
  • Pre-commit hooks pass (black, isort, ruff, bandit, security)

🤖 Generated with Claude Code

The v3 API uses fundamentally different response and request formats:
- Records list uses "records" key instead of "list"
- Record IDs use lowercase "id" instead of "Id"
- Field data is wrapped in a "fields" object
- Pagination uses cursor-based next/prev instead of pageInfo
- Create/update requests must wrap data in "fields" object

Added ResponseAdapter and RequestAdapter classes that transparently
handle v2/v3 format differences, keeping the public API consistent.
All existing v2 behavior remains unchanged (passthrough).
@github-actions
Copy link
Copy Markdown

🤖 AI Analysis for NocoDB Simple Client

Technical Summary

The pull request addresses significant differences in the handling of API responses and requests between NocoDB API v2 and v3. The updates ensure backward compatibility with API v2 while properly adapting the new formats introduced in v3.


Technical Requirements and Constraints

  1. API Response Handling:

    • Adapt the API v3 response, which uses key differences like "records" instead of "list", lowercase "id", and wrapping field data in a fields object.
    • Conversion must ensure correctness of pagination, which has changed from a pageInfo boolean system to a cursor-based next/prev format.
  2. API Request Handling:

    • Adapt v3 API requests for operations like Create, Update, Delete, and bulk operations, which require nesting field data in the {"fields": ...} structure.
  3. Backward Compatibility:

    • The system must continue to deliver 100% unchanged behavior

Impact Assessment

This issue/PR affects the NocoDB Simple Client Python library.


This summary was automatically generated by AI to help with triage and may not be 100% accurate.

@github-actions
Copy link
Copy Markdown

🔍 PR Validation Report

Overall Status: ✅ PASSED

Validation Results

Check Status Details
Conventional Commits ⏭️ SKIP success
Security Scan ⏭️ SKIP Score: 95/100
License Compliance ⏭️ SKIP compliant

🎉 Great job! All validation checks passed. This PR is ready for review.


Automated validation by Automation Templates

@karlspace karlspace merged commit 158d141 into main Mar 25, 2026
21 of 22 checks passed
@karlspace karlspace deleted the feature-20260130 branch March 25, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not support for API version 3

1 participant