aws / aws-pdk

The AWS PDK provides building blocks for common patterns together with development tools to manage and build your projects.
https://aws.github.io/aws-pdk/
Apache License 2.0
364 stars 73 forks source link

[FEATURE] (type-safe-api) only require OpenApi Generator when API changes #819

Open jstrunk opened 1 month ago

jstrunk commented 1 month ago

Describe the feature

Enable generated type-safe-api code to optionally be committed to the repo and only run OpenAPI Generator when the api spec is modified.

Use Case

I've heard developers say they are hesitant to adopt type-safe-api because it adds a dependency on the JDK and maven and that could be an issue for their customers. By committing the generated code, only developers who modify the API spec will need those dependencies.

Proposed Solution

No response

Other Information

No response

Acknowledgements

PDK version used

0.23.47

What languages will this feature affect?

Typescript, Java, Python

Environment details (OS name and version, etc.)

macos

abest0 commented 1 month ago

I believe this functionality could be helpful here in cases where one wants to provide a frozen API to a customer without passing on the additional dependencies.

I've seen cases where the team accepting the prototype consists of Data Scientists who have familiarity with Python and possibly some familiarity with JS/TS. When providing the full type-safe-api project as a deliverable (vs just the generated API), the customer must use JDK to even build the solution--this adds complexity to the delivered solution that's at odds with adoption.

I appreciate the commitGenerateCode option since it provides the ability to freeze/eject the API and just provide the generated assets.