Skip to content

Optimization - get field deserializers doesn't need to be passed the current object in most languages #1490

@baywet

Description

@baywet

The callback for field deserializers see this example doesn't need to be passed the current object.

Effectively this

{"aboutMe", (o,n) => { (o as User).AboutMe = n.GetStringValue(); } },

Can be changed to that

{"aboutMe", (n) => { this.AboutMe = n.GetStringValue(); } },

And the parent method return type can be simplified.

This will contribute to making the generated code smaller as well as the byte code, which has been a challenge for Go and TypeScript.

Metadata

Metadata

Assignees

Labels

CsharpPull requests that update .net codeGoJavaTypeScriptPull requests that update Javascript codefixedgeneratorIssues or improvements relater to generation capabilities.

Type

No type

Projects

Status

Done ✔️

Relationships

None yet

Development

No branches or pull requests

Issue actions