Adds support to generate a json schema for resource definitions. This allows for suggestions in editors:
The schema is generated via the schemars crate, it provides a derive macro which is placed above each struct that is relevant to resource definitions (locked behind the schemars feature). It can be generated by a subcommand of the new created xtask crate: e.g. cargo xtask generate resource-json-schema --pretty --stdout.
Although schemars is serde compatible in most parts, it's currently unable to create schema definitions for aliases. I've manually renamed fields where an alias is more understandable than the rust field name (via field attributes, the renames are exclusive to schemars). I've also looked if typeshare can generate a json schema, but it doesn't seem so.
If the PR gets accepted, it would be nice if the schema could be hosted on the komodo website, so users can directly include the url in their config files / LSPs and don't have to manually download / generate it. It might also be possible to generate parts of the resource docs on the komodo website by the json schema, but I haven't looked further into it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/moghtech/komodo/pull/1337
**Author:** [@bytedream](https://github.com/bytedream)
**Created:** 4/7/2026
**Status:** ✅ Merged
**Merged:** 5/6/2026
**Merged by:** [@mbecker20](https://github.com/mbecker20)
**Base:** `2.2.0` ← **Head:** `resource-json-schema`
---
### 📝 Commits (3)
- [`15636ad`](https://github.com/moghtech/komodo/commit/15636ad6473ada49393ce290852263b34d4ab427) add support to generate resource json schema
- [`ffbc65f`](https://github.com/moghtech/komodo/commit/ffbc65f5873cbf780c831486e02073b9aac7a082) remove unnecessary renames
- [`17de16e`](https://github.com/moghtech/komodo/commit/17de16ed820a55ad96959bb2878e7f6e714c4129) Merge branch '2.2.0' into resource-json-schema
### 📊 Changes
**39 files changed** (+390 additions, -12 deletions)
<details>
<summary>View changed files</summary>
📝 `.cargo/config.toml` (+4 -1)
📝 `Cargo.lock` (+38 -4)
📝 `Cargo.toml` (+4 -1)
📝 `client/core/rs/Cargo.toml` (+2 -0)
📝 `client/core/rs/src/api/execute/action.rs` (+2 -0)
📝 `client/core/rs/src/api/execute/alerter.rs` (+2 -0)
📝 `client/core/rs/src/api/execute/build.rs` (+3 -0)
📝 `client/core/rs/src/api/execute/deployment.rs` (+10 -0)
📝 `client/core/rs/src/api/execute/maintenance.rs` (+5 -0)
📝 `client/core/rs/src/api/execute/mod.rs` (+2 -0)
📝 `client/core/rs/src/api/execute/procedure.rs` (+2 -0)
📝 `client/core/rs/src/api/execute/repo.rs` (+7 -0)
📝 `client/core/rs/src/api/execute/server.rs` (+21 -0)
📝 `client/core/rs/src/api/execute/stack.rs` (+14 -0)
📝 `client/core/rs/src/api/execute/swarm.rs` (+10 -0)
📝 `client/core/rs/src/api/execute/sync.rs` (+1 -0)
📝 `client/core/rs/src/api/write/sync.rs` (+1 -0)
📝 `client/core/rs/src/entities/action.rs` (+4 -0)
📝 `client/core/rs/src/entities/alert.rs` (+5 -0)
📝 `client/core/rs/src/entities/alerter.rs` (+10 -0)
_...and 19 more files_
</details>
### 📄 Description
Adds support to generate a json schema for resource definitions. This allows for suggestions in editors:
<img width="1160" height="434" alt="image" src="https://github.com/user-attachments/assets/f60bf5b6-c075-4388-8671-5f9be0fa6694" />
The schema is generated via the `schemars` crate, it provides a derive macro which is placed above each struct that is relevant to resource definitions (locked behind the `schemars` feature). It can be generated by a subcommand of the new created `xtask` crate: e.g. `cargo xtask generate resource-json-schema --pretty --stdout`.
Although `schemars` is serde compatible in most parts, it's currently unable to create schema definitions for aliases. I've manually renamed fields where an alias is more understandable than the rust field name (via field attributes, the renames are exclusive to `schemars`). I've also looked if `typeshare` can generate a json schema, but it doesn't seem so.
If the PR gets accepted, it would be nice if the schema could be hosted on the komodo website, so users can directly include the url in their config files / LSPs and don't have to manually download / generate it.<br>It might also be possible to generate parts of the resource docs on the komodo website by the json schema, but I haven't looked further into it.
---
Relies on https://github.com/mbecker20/partial_derive2/pull/1 to compile (hence the changed `partial_derive2` dependency, the rev points to the PR head) and https://github.com/mbecker20/partial_derive2/pull/2 to include all comments.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/moghtech/komodo/pull/1337
Author: @bytedream
Created: 4/7/2026
Status: ✅ Merged
Merged: 5/6/2026
Merged by: @mbecker20
Base:
2.2.0← Head:resource-json-schema📝 Commits (3)
15636adadd support to generate resource json schemaffbc65fremove unnecessary renames17de16eMerge branch '2.2.0' into resource-json-schema📊 Changes
39 files changed (+390 additions, -12 deletions)
View changed files
📝
.cargo/config.toml(+4 -1)📝
Cargo.lock(+38 -4)📝
Cargo.toml(+4 -1)📝
client/core/rs/Cargo.toml(+2 -0)📝
client/core/rs/src/api/execute/action.rs(+2 -0)📝
client/core/rs/src/api/execute/alerter.rs(+2 -0)📝
client/core/rs/src/api/execute/build.rs(+3 -0)📝
client/core/rs/src/api/execute/deployment.rs(+10 -0)📝
client/core/rs/src/api/execute/maintenance.rs(+5 -0)📝
client/core/rs/src/api/execute/mod.rs(+2 -0)📝
client/core/rs/src/api/execute/procedure.rs(+2 -0)📝
client/core/rs/src/api/execute/repo.rs(+7 -0)📝
client/core/rs/src/api/execute/server.rs(+21 -0)📝
client/core/rs/src/api/execute/stack.rs(+14 -0)📝
client/core/rs/src/api/execute/swarm.rs(+10 -0)📝
client/core/rs/src/api/execute/sync.rs(+1 -0)📝
client/core/rs/src/api/write/sync.rs(+1 -0)📝
client/core/rs/src/entities/action.rs(+4 -0)📝
client/core/rs/src/entities/alert.rs(+5 -0)📝
client/core/rs/src/entities/alerter.rs(+10 -0)...and 19 more files
📄 Description
Adds support to generate a json schema for resource definitions. This allows for suggestions in editors:

The schema is generated via the
schemarscrate, it provides a derive macro which is placed above each struct that is relevant to resource definitions (locked behind theschemarsfeature). It can be generated by a subcommand of the new createdxtaskcrate: e.g.cargo xtask generate resource-json-schema --pretty --stdout.Although
schemarsis serde compatible in most parts, it's currently unable to create schema definitions for aliases. I've manually renamed fields where an alias is more understandable than the rust field name (via field attributes, the renames are exclusive toschemars). I've also looked iftypesharecan generate a json schema, but it doesn't seem so.If the PR gets accepted, it would be nice if the schema could be hosted on the komodo website, so users can directly include the url in their config files / LSPs and don't have to manually download / generate it.
It might also be possible to generate parts of the resource docs on the komodo website by the json schema, but I haven't looked further into it.
Relies on https://github.com/mbecker20/partial_derive2/pull/1 to compile (hence the changed
partial_derive2dependency, the rev points to the PR head) and https://github.com/mbecker20/partial_derive2/pull/2 to include all comments.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.