Skip to content

[DRAFT] FLARE Protocol Codegen PoC Code#12

Draft
constewart9 wants to merge 8 commits intomainfrom
conorstw/types-poc
Draft

[DRAFT] FLARE Protocol Codegen PoC Code#12
constewart9 wants to merge 8 commits intomainfrom
conorstw/types-poc

Conversation

@constewart9
Copy link
Owner

Problem

Definitions in chat.ts are not shared between FLARE and IDE Q plugins. Differences in definitions can lead to runtime errors. Need to move towards a single source of truth that can be used to generate definitions in all client languages, starting with TypeScript.

Solution

This PR demonstrates different code generator Proof of Concepts for generating TypeScript, Kotlin, Java, and C#. The following five options were considered: Smithy, Quicktype, OpenAPI Generator, Protobuf, and a custom-made generator (which uses a structured TypeScript format to generate code in the required languages in a way similar to JSON).

To learn more about each and the pros/cons, see the READMEs for each generator test. There is also instructions to test these generators yourself in the README.

types/codegen/
├── openAPI/
├── protobuf/
├── quicktype/
├── self-made-generator/
├── smithy/
└── README.md

The generated code was considered based on out-of-the-box fit, language support, extensibility and maintainability (ie how good is the documentation for each generator? How well supported is it?), and customizability to match our use case.

Ultimately, OpenAPI generator was decided to be the best fit.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant