Skip to content

ITEP-87119: Update API spec to match REST implementation#1424

Merged
sbelhaik merged 30 commits into
mainfrom
fix/ITEP-87119-update-api-spec-web-service
May 19, 2026
Merged

ITEP-87119: Update API spec to match REST implementation#1424
sbelhaik merged 30 commits into
mainfrom
fix/ITEP-87119-update-api-spec-web-service

Conversation

@daddo-intel
Copy link
Copy Markdown
Contributor

📝 Description

Provide a clear summary of the changes and the context behind them. Describe what was changed, why it was needed, and how the changes address the issue or add value.

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests
  • 🚂 CI

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Ran automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
Comment thread docs/user-guide/api-docs/api.yaml Outdated
@sbelhaik
Copy link
Copy Markdown
Contributor

@daddo-intel Get all endpoints are missing (/scenes, /cameras,...etc)
some other endpoints are also missing, you can extract all API paths from manager and check the missing endpoints.

@daddo-intel daddo-intel marked this pull request as ready for review May 14, 2026 11:30
Copy link
Copy Markdown
Contributor

@ltalarcz ltalarcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: API Spec Migration (Swagger 2.0 → OpenAPI 3.0.3)

Recommendation: Request Changes

OpenAPI 3.0.3 syntax is valid (passes openapi-spec-validator), but there are still some gaps vs the actual Django implementation.

Must Fix

  1. Security is wrong on 2 endpoints:

    • /import-scene/ — spec says no auth (security: []), but code requires Token auth (request.auth.key is used)
    • /save-geospatial-snapshot/ — spec says no auth, but code has @login_required
  2. 3 endpoints completely missing from spec:

    • GET /database-ready — health check
    • POST /calculateintrinsics — camera intrinsics calculation
    • POST /aclcheck — MQTT ACL check
  3. POST method missing on all list endpoints (/scenes, /cameras, /sensors, /regions, /tripwires, /users, /assets, /calibrationmarkers, /scenes/child) — spec only shows GET, but ListCreateAPIView also handles POST (create).

Should Fix

  1. Filter query params undocumented — list endpoints accept name, parent, scene, username, id filters, only page is in spec.

  2. UID parameter names are misleading:

    • /user/{uid} → should be /user/{username} (lookup is by username)
    • /camera/{uid}, /sensor/{uid} → actual lookup is by sensor_id
    • /calibrationmarker/{uid} → actual lookup is by marker_id

@sbelhaik
Copy link
Copy Markdown
Contributor

sbelhaik commented May 15, 2026

Review: API Spec Migration (Swagger 2.0 → OpenAPI 3.0.3)

Recommendation: Request Changes

OpenAPI 3.0.3 syntax is valid (passes openapi-spec-validator), but there are still some gaps vs the actual Django implementation.

Must Fix

  1. Security is wrong on 2 endpoints:

    • /import-scene/ — spec says no auth (security: []), but code requires Token auth (request.auth.key is used)
    • /save-geospatial-snapshot/ — spec says no auth, but code has @login_required
  2. 3 endpoints completely missing from spec:

    • GET /database-ready — health check
    • POST /calculateintrinsics — camera intrinsics calculation
    • POST /aclcheck — MQTT ACL check
  3. POST method missing on all list endpoints (/scenes, /cameras, /sensors, /regions, /tripwires, /users, /assets, /calibrationmarkers, /scenes/child) — spec only shows GET, but ListCreateAPIView also handles POST (create).

Should Fix

  1. Filter query params undocumented — list endpoints accept name, parent, scene, username, id filters, only page is in spec.

  2. UID parameter names are misleading:

    • /user/{uid} → should be /user/{username} (lookup is by username)
    • /camera/{uid}, /sensor/{uid} → actual lookup is by sensor_id
    • /calibrationmarker/{uid} → actual lookup is by marker_id
  • POST method missing: this is not valid, the singular endpoints (/scene, /camera, ...etc) handle post request.
  • Remaining comments have been addressed.

@sbelhaik sbelhaik requested a review from ltalarcz May 15, 2026 13:51
@sbelhaik sbelhaik force-pushed the fix/ITEP-87119-update-api-spec-web-service branch from 5cc2e36 to a55c4c3 Compare May 15, 2026 14:03
@sbelhaik sbelhaik self-requested a review May 19, 2026 13:55
@sbelhaik sbelhaik merged commit 9f162c1 into main May 19, 2026
32 checks passed
@sbelhaik sbelhaik deleted the fix/ITEP-87119-update-api-spec-web-service branch May 19, 2026 13:56
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.

3 participants