svenheden / csharp-models-to-typescript

C# models to TypeScript
89 stars 58 forks source link

Force custom translation if any before parse checks #43

Open vanilsonbr opened 4 years ago

vanilsonbr commented 4 years ago

Force the custom translation defined by the user before perfoming other checks.

There are some problems when the user tries to custom translate an C# Array to a javascript type. I've trying to custom translate byte[] to string, but it ended up translating it to string[].

I had similar problems trying to translate Model[] to AnotherModel[]. My config-file.json at "customTypeTranslations" was sometinh like this:

{
  "byte[]": "string",
  "Model[]": "AnotherModel[]"
}

In this case, I'm assuming that the dev knows what he's doing when he, by adding a custom translation, chooses to translate, for example, and array of Model to an array of AnotherModel.

Closes #33