-
Notifications
You must be signed in to change notification settings - Fork 4
fix: make example code optional for brick example details endpoint request #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dido18
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would organize the testdata with the content of the assets folder
Something like
testdata/assets
└── 0.4.8
│ ├── compose
│ │ └── arduino
│ │ ├── arduino_cloud
│ ├── docs
│ │ └── arduino
│ │ ├── arduino_cloud
│ └── examples
│ └── arduino
│ ├── arduino_cloud
internal/store/testdata/assets/0.4.8/compose/arduino/arduino_cloud/brick_compose.yaml
Outdated
Show resolved
Hide resolved
dido18
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example of the HTTP response of the BricksDetails endpoint when the brick does not have the examples?
I would like to check the code_examples json field.
and avoid code_exampes:null response
|
@dido18 here a response with no examples {
"id": "arduino:mood_detector",
"name": "Mood Detection",
"author": "Arduino",
"description": "This brick analyzes text sentiment to detect the mood expressed.\nIt classifies text as positive, negative, or neutral.\n",
"category": "text",
"status": "installed",
"readme": "# Mood detector brick\n\nThis brick analyzes text sentiment to detect the mood expressed.\nIt classifies text as positive, negative, or neutral.\n\nExamples:\n- \"I love this board!\" -\u003E positive\n- \"The weather is awful\" -\u003E negative\n- \"I am sad today\" -\u003E negative\n- \"The temperature is 25\" -\u003E neutral\n\n## Code example and usage\n\n```python\nfrom arduino.app_bricks.mood_detector import MoodDetector\n\nmood_detection = MoodDetector()\n\n# Output: positive\nprint(mood_detection.get_sentiment(\"this application is nice\"))\n```\n",
"api_docs_path": "/home/mirkocrobu/.config/arduino-app-cli/assets/0.4.8/api-docs/arduino/app_bricks/mood_detector/API.md",
"code_examples": [],
"used_by_apps": null
} |
fix: make example code optional for brick example details endpoint request
Motivation
closes #795
Following bricks return 500 when asking for details.
These specific bricks do not have an associated code example. When details are requested, the system erroneously raises an error because the example is not found, rather than handling the missing data gracefully (by returning an empty field).
Change description
Additional Notes
Reviewer checklist
main.