Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.