From 2035cc290740776264b9102a9bbc31ce194ff6ff Mon Sep 17 00:00:00 2001 From: Daniel Brondani Date: Fri, 25 Jul 2025 09:57:07 +0200 Subject: [PATCH 1/3] [rpc api] Add `GetApplications` method --- api/csolution-openapi.yml | 151 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index 4d71dd7..0ff3850 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -164,6 +164,17 @@ paths: '200': description: OK content: {application/json: {schema: {$ref: '#/components/schemas/GetLogMessagesResponse'}}} + /rpc/GetApplications: + post: + summary: Get applications + description: Get reference applications, examples and solution templates + tags: [/rpc] + requestBody: + content: {application/json: {schema: {$ref: '#/components/schemas/GetApplicationsRequest'}}} + responses: + '200': + description: OK + content: {application/json: {schema: {$ref: '#/components/schemas/GetApplicationsResponse'}}} components: schemas: @@ -470,6 +481,125 @@ components: items: type: string + ApplicationsFilter: + type: object + properties: + board: + type: string + description: Board Identifier + device: + type: string + description: Device Identifier + environment: + type: string + description: Name of the environment + Environment: + type: object + properties: + name: + type: string + description: Name of the environment + file: + type: string + description: Project file to be loaded + folder: + type: string + description: Folder containing all example files + required: + - name + - file + - folder + Example: + type: object + properties: + name: + type: string + description: Name of the example + description: + type: string + description: Brief description + doc: + type: string + description: Document that describes the example + version: + type: string + description: Example version number + archive: + type: string + description: Archive file containing all files and sub-folders + pack: + type: string + description: Pack identifier + environments: + type: array + items: + $ref: '#/components/schemas/Environment' + description: List of environments + components: + type: array + items: + type: string + description: List of related components + categories: + type: array + items: + type: string + description: List of categories + keywords: + type: array + items: + type: string + description: List of keywords + required: + - name + - description + - doc + - environments + - pack + SolutionTemplate: + type: object + properties: + name: + type: string + description: Name of the template + description: + type: string + description: Brief description + file: + type: string + description: Name of the *.csolution.yml file + folder: + type: string + description: Folder containing the template + copyTo: + type: string + description: Path to copy the template into the csolution project + pack: + type: string + description: Pack identifier + required: + - name + - description + - file + - folder + - pack + ApplicationsInfo: + allOf: + - $ref: '#/components/schemas/SuccessResult' + - properties: + examples: + type: array + items: + $ref: '#/components/schemas/Example' + refApps: + type: array + items: + $ref: '#/components/schemas/Example' + templates: + type: array + items: + $ref: '#/components/schemas/SolutionTemplate' + GetVersionRequest: allOf: - $ref: '#/x-jsonrpc-envelope-request' @@ -758,6 +888,27 @@ components: result: $ref: '#/components/schemas/LogMessages' + GetApplicationsRequest: + allOf: + - $ref: '#/x-jsonrpc-envelope-request-with-params' + - properties: + method: + type: string + const: GetApplications + params: + type: object + properties: + filter: + $ref: '#/components/schemas/ApplicationsFilter' + required: + - filter + GetApplicationsResponse: + allOf: + - $ref: '#/x-jsonrpc-envelope-response' + - properties: + result: + $ref: '#/components/schemas/ApplicationsInfo' + x-jsonrpc-envelope-request: allOf: - $ref: '#/x-jsonrpc-envelope' From f462c9e0f14e61b3a4199b94b275dc6f56796dcf Mon Sep 17 00:00:00 2001 From: Daniel Brondani Date: Fri, 25 Jul 2025 11:17:14 +0200 Subject: [PATCH 2/3] Address feedback --- api/csolution-openapi.yml | 40 ++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index 0ff3850..4417e1e 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -164,17 +164,17 @@ paths: '200': description: OK content: {application/json: {schema: {$ref: '#/components/schemas/GetLogMessagesResponse'}}} - /rpc/GetApplications: + /rpc/GetDraftProjects: post: - summary: Get applications + summary: Get draft projects description: Get reference applications, examples and solution templates tags: [/rpc] requestBody: - content: {application/json: {schema: {$ref: '#/components/schemas/GetApplicationsRequest'}}} + content: {application/json: {schema: {$ref: '#/components/schemas/GetDraftProjectsRequest'}}} responses: '200': description: OK - content: {application/json: {schema: {$ref: '#/components/schemas/GetApplicationsResponse'}}} + content: {application/json: {schema: {$ref: '#/components/schemas/GetDraftProjectsResponse'}}} components: schemas: @@ -481,7 +481,7 @@ components: items: type: string - ApplicationsFilter: + DraftProjectsFilter: type: object properties: board: @@ -490,10 +490,12 @@ components: device: type: string description: Device Identifier - environment: - type: string - description: Name of the environment - Environment: + environments: + type: array + items: + type: string + description: Environment names + ExampleEnvironment: type: object properties: name: @@ -509,7 +511,7 @@ components: - name - file - folder - Example: + ExampleProject: type: object properties: name: @@ -533,7 +535,7 @@ components: environments: type: array items: - $ref: '#/components/schemas/Environment' + $ref: '#/components/schemas/ExampleEnvironment' description: List of environments components: type: array @@ -583,18 +585,18 @@ components: - file - folder - pack - ApplicationsInfo: + DraftProjectsInfo: allOf: - $ref: '#/components/schemas/SuccessResult' - properties: examples: type: array items: - $ref: '#/components/schemas/Example' + $ref: '#/components/schemas/ExampleProject' refApps: type: array items: - $ref: '#/components/schemas/Example' + $ref: '#/components/schemas/ExampleProject' templates: type: array items: @@ -888,26 +890,26 @@ components: result: $ref: '#/components/schemas/LogMessages' - GetApplicationsRequest: + GetDraftProjectsRequest: allOf: - $ref: '#/x-jsonrpc-envelope-request-with-params' - properties: method: type: string - const: GetApplications + const: GetDraftProjects params: type: object properties: filter: - $ref: '#/components/schemas/ApplicationsFilter' + $ref: '#/components/schemas/DraftProjectsFilter' required: - filter - GetApplicationsResponse: + GetDraftProjectsResponse: allOf: - $ref: '#/x-jsonrpc-envelope-response' - properties: result: - $ref: '#/components/schemas/ApplicationsInfo' + $ref: '#/components/schemas/DraftProjectsInfo' x-jsonrpc-envelope-request: allOf: From d2f24f64b06f7177502d4eff01249d1c328fbc38 Mon Sep 17 00:00:00 2001 From: Daniel Brondani Date: Tue, 29 Jul 2025 13:56:47 +0200 Subject: [PATCH 3/3] Increase csolution rpc api version --- api/csolution-openapi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/csolution-openapi.yml b/api/csolution-openapi.yml index 4417e1e..788d89d 100644 --- a/api/csolution-openapi.yml +++ b/api/csolution-openapi.yml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: csolution rpc - version: 0.0.2 + version: 0.0.3 description: Specification of remote procedure call methods for CMSIS csolution integration license: name: Apache 2.0