What an amazing article! I integrated the ideas here into our project and stopped the divergence between Typescript interfaces and a home-grown api-models.json file that contained the model definitions!
Have you considered instead of generating the OpenAPI documentation and JSONSchema from code that you instead start with the OpenAPI documentation and use that as the single source of truth. That way you could define an OpenAPI document that is used to generate types for both the client and server as well as can be easily converted to JSONSchema for API validation.
I found the following library that does somewhat of what I mentioned above npmjs.com/package/@alma-cdk/openapix but they use SpecRestAPI construct under the hood. I'm going to try in my own project use the RestAPI construct and build the Models from the JSONSchema generated from the OpenAPI documentation.
Btw great articles I'm really liking them.
Bar Miliavsky
I know it's been years but I just stumbled upon this article. I was looking into doing something like that for my project and this post and comments are a great resource for me! thank you!