Closed amckinney closed 1 week ago
This adds support for nil-safe getter methods for each generated type. Callers can more easily access nested properties by chaining together getter method calls instead of a long series of != nil checks.
!= nil
For example,
Before
response, err := client.Users.Get(ctx, "john.doe") if err != nil { return nil, err } if response.User != nil && response.User.Address != nil { return response.User.Address.Street, nil }
After
response, err := client.Users.Get(ctx, "john.doe") if err != nil { return nil, err } if address := response.GetUser().GetAddress(); address != nil { return address.Street, nil }
🌿 Preview your docs: https://fern-preview-e4d0b737-4f47-4e4e-bd73-a57871530698.docs.buildwithfern.com/learn
This adds support for nil-safe getter methods for each generated type. Callers can more easily access nested properties by chaining together getter method calls instead of a long series of
!= nil
checks.For example,
Before
After