telescope
telescope copied to clipboard
managing internal/external API casing
Seems that amino coding is more simple when using original casing, but RPC returns proto/camel casing. It's quite the task to manage two sets of types or numerous sets of types for this, so this issue is an attempt to come up with solutions to manage this all:
https://github.com/sindresorhus/type-fest#change-case
do it ‘backwards’
- do keepCase: true
- then expose CamelCaseDeep typing on the “Edge” the developer APIs
- potentially use fromSDKToCamel or fromSDKtoSnake (make these) to the API
- depending on what the dev wants (camel vs snake)
If there are some cases that diverge (e.g. json_name
or gogoproto.jsontag
) from casing, we may be able to use the merge type to "fix" them if we use the above solution.
There is a merge type if you need it. If you need to make an exception, maybe you could make an exception and merge them
https://github.com/scrtlabs/secret.js/commit/92652879ac2975b1a67f8510e01c1a32685b939f