Custom typescript-ref serializer

We have a custom permissions system and we would like to be able to serialize all static or const values for the dto generator (so we don’t have to duplicate our list of permissions server and client side).

Is there any level of customization where we can add to the generated DTO output, or register custom Dto interface serializers?

Or maybe you can point me in the direction of how you do the dto generation so maybe we can standup a custom endpoint for generating a very custom one?

The only level of customization is what’s listed in the customization options which can also be pre-configured on the server with:

var nativeTypes = this.GetPlugin<NativeTypesFeature>();
nativeTypes.MetadataTypesConfig...

and some other options specific to TypeScript available as static properties on the TypeScriptGenerator class.

You can check out TypeScriptGenerator.cs to see how it works, but it’s essentially just using reflection to generate TypeScript code in a StringBuilder and returning a raw text response.