Skip to content

Conversation

rasmusrygaard
Copy link
Contributor

Add annotations and an export script that let us generate app-server protocol types as typescript and JSONSchema.

The script itself is a bit hacky because we need to manually label some of the types. Unfortunately it seems that enum variants don't get good names by default and end up with something like EventMsg1, EventMsg2, etc. I'm not an expert in this by any means, but since this is only run manually and we already need to enumerate the types required to describe the protocol, it didn't seem that much worse. An ideal solution here would be to have some kind of root that we could generate schemas for in one go, but I'm not sure if that's compatible with how we generate the protocol today.

Copy link

github-actions bot commented Oct 10, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@rasmusrygaard
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@rasmusrygaard
Copy link
Contributor Author

recheck

github-actions bot added a commit that referenced this pull request Oct 10, 2025

/// Optional Prettier executable path to format generated TypeScript files
#[arg(short = 'p', long = "prettier", value_name = "PRETTIER_BIN")]
prettier: Option<PathBuf>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need a switch for cases that don't care about OpenAPI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codex add a switch to control this, turn it on by default

Copy link
Contributor

Choose a reason for hiding this comment

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

Summary

Testing

  • just fmt

View task →

@rasmusrygaard rasmusrygaard force-pushed the dev/rasmus/generate_json_schema2 branch from 2cc4861 to 591304d Compare October 20, 2025 18:22
@rasmusrygaard rasmusrygaard merged commit 846960a into main Oct 20, 2025
20 checks passed
@rasmusrygaard rasmusrygaard deleted the dev/rasmus/generate_json_schema2 branch October 20, 2025 18:45
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants