tutone icon indicating copy to clipboard operation
tutone copied to clipboard

feat(typegen): support generating fields as pointers, including lists/slices

Open sanderblue opened this issue 2 years ago • 0 comments

⚠️ WIP: Early POC ⚠️

Adds support for always prepending * for a struct field type, especially in the case of lists. We currently don't support this functionality for lists. In the example below, the destination configurations are optional, so we would want to omit empty and use a pointer for JSON serialization.

e.g.

    - name: AiWorkflowsDestinationConfigurationInput
      create_as_pointer: true

Would result in the following generated struct field:

type AiWorkflowsCreateWorkflowInput struct {
	DestinationConfigurations *[]AiWorkflowsDestinationConfigurationInput `json:"destinationConfigurations,omitempty"`
  // ...

sanderblue avatar Nov 28 '22 22:11 sanderblue