Skip to content

Conversation

@dido18
Copy link
Contributor

@dido18 dido18 commented Dec 17, 2025

Motivation

The Applab expcts that the GET /v1/apps/:id/bricks and GET v1/apps/:id/bricks/:id return the same JSON response.

Current

arduino@dido:/$ curl 127.0.0.1:8800/v1/apps/ZXhhbXBsZXM6cmVhbC10aW1lLWFjY2VsZXJvbWV0ZXI/bricks | jq
{
  "bricks": [
    {
      "id": "arduino:web_ui",
      "name": "WebUI - HTML",
      "author": "Arduino",
      "category": "ui",
      "status": "installed",
      "require_model": false
    },
    {
      "id": "arduino:motion_detection",
      "name": "Motion detection",
      "author": "Arduino",
      "category": "",
      "status": "installed",
      "require_model": true
    }
  ]
}

Change description

Use the same struct for both endpoints.

New response

curl 127.0.0.1:8800/v1/apps/ZXhhbXBsZXM6cmVhbC10aW1lLWFjY2VsZXJvbWV0ZXI/bricks  
{
  "bricks": [
    {
      "id": "arduino:web_ui",
      "name": "WebUI - HTML",
      "author": "Arduino",
      "category": "ui",
      "status": "installed",
      "require_model": false,
      "compatible_models": []
    },
    {
      "id": "arduino:motion_detection",
      "name": "Motion detection",
      "author": "Arduino",
      "category": "",
      "status": "installed",
      "require_model": true,
      "model": "updown-wave-motion-detection",
      "compatible_models": [
        {
          "id": "updown-wave-motion-detection",
          "name": "Continuous motion detection",
          "description": "A motion detection model designed to identify up/down, wave, and snake movements evalauting accelerometer data."
        }
      ]
    }
  ]
}

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@dido18 dido18 requested a review from a team December 17, 2025 13:59
@dido18 dido18 changed the title Fix: get /apps/:id/bricks must reutns the compatiable modeld and the model selected Fix: get /apps/:id/bricks must retuns the same response of /apps/:id/bricks/:id Dec 17, 2025
dido18 and others added 2 commits December 17, 2025 15:17
Co-authored-by: Luca Rinaldi <l.rinaldi@arduino.cc>
Co-authored-by: Luca Rinaldi <l.rinaldi@arduino.cc>
Co-authored-by: Luca Rinaldi <l.rinaldi@arduino.cc>
@davegarthsimpson davegarthsimpson changed the title Fix: get /apps/:id/bricks must retuns the same response of /apps/:id/bricks/:id Fix: get /apps/:id/bricks must return the same response as /apps/:id/bricks/:id Dec 17, 2025
@dido18 dido18 merged commit 19c9d62 into main Dec 17, 2025
6 checks passed
@dido18 dido18 deleted the fix-app-bricks branch December 17, 2025 14:54
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.

2 participants