Open lan-lyu opened 1 year ago
The generic version looks like a good start. Ideally we switch more of the any
to be concrete types (for example in the get
method). That will make the code safer to use and easier to debug. However, feel free to just add todo comments if you run into troubles and I can help.
I create 2 versions of generated
data
class example and its test.Folder Structure
Each folder has 3 files
__util__.ts
: definiton of BaseObejct and methodsdata.ts
: generated data class from TopLevelUnitSpectest.ts
: import methods in data.ts and generate JSONDetails
Data class with generic looks like this
When run
test.ts
The output is