Skip to content

Conversation

@shanaya-Gupta
Copy link

Fix for Issue #55

Issue: Get the name of the board

Changes:

  • Modified: internal/api/api.go, internal/api/docs/openapi.yaml

Please review carefully before merging.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@per1234 per1234 added the enhancement New feature or request label Nov 9, 2025
type: object


/v1/system/name:

Choose a reason for hiding this comment

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

It might be better to use a more generic endpoint like /v1/system/information.
This would make the API more cohesive and easier to extend in the future if new properties are added that still fall under the general “information” category.

If you only need to retrieve the system name, you could either include a query parameter filter (e.g. ?filter=name) or use a more specific endpoint such as /v1/system/information/name.

Choose a reason for hiding this comment

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

the openapi.yaml file is generated from cmd/gendoc/docs.go file.

You have to add your definition programmatically.

You can take inspiration from:

'data: {"code":"INTERNAL_SERVER_ERROR","message":"An error occurred during operation"}'
`,
},
Description: "Returns the system resources usage, such as memory, disk and CPU.",
Summary: "Get system resources usage",
Tags: []Tag{SystemTag},
PossibleErrors: []ErrorResponse{
{StatusCode: http.StatusInternalServerError, Reference: "#/components/responses/InternalServerError"},
},
},
{
OperationId: "checkUpdate",
Method: http.MethodGet,
Path: "/v1/system/update/check",
Parameters: (*struct {
OnlyArduino bool `query:"only-arduino" description:"If true, check only for Arduino packages that require an upgrade. Default is false."`
})(nil),
CustomSuccessResponse: &CustomResponseDef{
ContentType: "application/json",
DataStructure: handlers.UpdateCheckResult{},
Description: "Successful response",
StatusCode: http.StatusOK,
},
Description: "Returns the details of packages to be upgraded.",
Summary: "Get the packages that requires an upgrade",
Tags: []Tag{SystemTag},
PossibleErrors: []ErrorResponse{
{StatusCode: http.StatusInternalServerError, Reference: "#/components/responses/InternalServerError"},
{StatusCode: http.StatusBadRequest, Reference: "#/components/responses/BadRequest"},
{StatusCode: http.StatusNoContent, Reference: "#/components/responses/NoContent"},
},

Choose a reason for hiding this comment

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

@lucarin91 perhaps would be better to go back to spec first approach, to ease future contributions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants