Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#1844)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent 7b8a09a commit e1ec709
Show file tree
Hide file tree
Showing 96 changed files with 138 additions and 126 deletions.
22 changes: 11 additions & 11 deletions accounts/member.go
Expand Up @@ -38,7 +38,7 @@ func NewMemberService(opts ...option.RequestOption) (r *MemberService) {
func (r *MemberService) New(ctx context.Context, params MemberNewParams, opts ...option.RequestOption) (res *UserWithInviteCode, err error) {
opts = append(r.Options[:], opts...)
var env MemberNewResponseEnvelope
path := fmt.Sprintf("accounts/%v/members", params.AccountID)
path := fmt.Sprintf("accounts/%s/members", params.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
if err != nil {
return
Expand All @@ -51,7 +51,7 @@ func (r *MemberService) New(ctx context.Context, params MemberNewParams, opts ..
func (r *MemberService) Update(ctx context.Context, memberID string, params MemberUpdateParams, opts ...option.RequestOption) (res *shared.Member, err error) {
opts = append(r.Options[:], opts...)
var env MemberUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID)
path := fmt.Sprintf("accounts/%s/members/%s", params.AccountID, memberID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return
Expand All @@ -65,7 +65,7 @@ func (r *MemberService) List(ctx context.Context, params MemberListParams, opts
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%v/members", params.AccountID)
path := fmt.Sprintf("accounts/%s/members", params.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...)
if err != nil {
return nil, err
Expand All @@ -87,7 +87,7 @@ func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListPar
func (r *MemberService) Delete(ctx context.Context, memberID string, body MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env MemberDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%v/members/%s", body.AccountID, memberID)
path := fmt.Sprintf("accounts/%s/members/%s", body.AccountID, memberID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand All @@ -100,7 +100,7 @@ func (r *MemberService) Delete(ctx context.Context, memberID string, body Member
func (r *MemberService) Get(ctx context.Context, memberID string, query MemberGetParams, opts ...option.RequestOption) (res *shared.Member, err error) {
opts = append(r.Options[:], opts...)
var env MemberGetResponseEnvelope
path := fmt.Sprintf("accounts/%v/members/%s", query.AccountID, memberID)
path := fmt.Sprintf("accounts/%s/members/%s", query.AccountID, memberID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -322,7 +322,7 @@ func (r memberDeleteResponseJSON) RawJSON() string {
}

type MemberNewParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
// The contact email address of the user.
Email param.Field[string] `json:"email,required"`
// Array of roles associated with this member.
Expand Down Expand Up @@ -393,8 +393,8 @@ func (r MemberNewResponseEnvelopeSuccess) IsKnown() bool {
}

type MemberUpdateParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
Member shared.MemberParam `json:"member,required"`
AccountID param.Field[string] `path:"account_id,required"`
Member shared.MemberParam `json:"member,required"`
}

func (r MemberUpdateParams) MarshalJSON() (data []byte, err error) {
Expand Down Expand Up @@ -445,7 +445,7 @@ func (r MemberUpdateResponseEnvelopeSuccess) IsKnown() bool {
}

type MemberListParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
// Direction to order results.
Direction param.Field[MemberListParamsDirection] `query:"direction"`
// Field to order results by.
Expand Down Expand Up @@ -518,7 +518,7 @@ func (r MemberListParamsStatus) IsKnown() bool {
}

type MemberDeleteParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
}

type MemberDeleteResponseEnvelope struct {
Expand Down Expand Up @@ -565,7 +565,7 @@ func (r MemberDeleteResponseEnvelopeSuccess) IsKnown() bool {
}

type MemberGetParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
}

type MemberGetResponseEnvelope struct {
Expand Down
10 changes: 5 additions & 5 deletions accounts/member_test.go
Expand Up @@ -30,7 +30,7 @@ func TestMemberNewWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Accounts.Members.New(context.TODO(), accounts.MemberNewParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
Email: cloudflare.F("user@example.com"),
Roles: cloudflare.F([]string{"3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb"}),
Status: cloudflare.F(accounts.MemberNewParamsStatusAccepted),
Expand Down Expand Up @@ -62,7 +62,7 @@ func TestMemberUpdate(t *testing.T) {
context.TODO(),
"4536bcfad5faccb111b47003c79917fa",
accounts.MemberUpdateParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
Member: shared.MemberParam{
Roles: cloudflare.F([]shared.MemberRoleParam{{
ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"),
Expand Down Expand Up @@ -98,7 +98,7 @@ func TestMemberListWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Accounts.Members.List(context.TODO(), accounts.MemberListParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
Direction: cloudflare.F(accounts.MemberListParamsDirectionDesc),
Order: cloudflare.F(accounts.MemberListParamsOrderStatus),
Page: cloudflare.F(1.000000),
Expand Down Expand Up @@ -132,7 +132,7 @@ func TestMemberDelete(t *testing.T) {
context.TODO(),
"4536bcfad5faccb111b47003c79917fa",
accounts.MemberDeleteParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
},
)
if err != nil {
Expand Down Expand Up @@ -162,7 +162,7 @@ func TestMemberGet(t *testing.T) {
context.TODO(),
"4536bcfad5faccb111b47003c79917fa",
accounts.MemberGetParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
},
)
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions accounts/role.go
Expand Up @@ -39,8 +39,8 @@ func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...op
var raw *http.Response
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%v/roles", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
path := fmt.Sprintf("accounts/%s/roles", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand All @@ -61,7 +61,7 @@ func (r *RoleService) ListAutoPaging(ctx context.Context, query RoleListParams,
func (r *RoleService) Get(ctx context.Context, roleID interface{}, query RoleGetParams, opts ...option.RequestOption) (res *RoleGetResponseUnion, err error) {
opts = append(r.Options[:], opts...)
var env RoleGetResponseEnvelope
path := fmt.Sprintf("accounts/%v/roles/%v", query.AccountID, roleID)
path := fmt.Sprintf("accounts/%s/roles/%v", query.AccountID, roleID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return
Expand All @@ -87,11 +87,11 @@ func init() {
}

type RoleListParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
}

type RoleGetParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
AccountID param.Field[string] `path:"account_id,required"`
}

type RoleGetResponseEnvelope struct {
Expand Down
4 changes: 2 additions & 2 deletions accounts/role_test.go
Expand Up @@ -29,7 +29,7 @@ func TestRoleList(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Accounts.Roles.List(context.TODO(), accounts.RoleListParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
})
if err != nil {
var apierr *cloudflare.Error
Expand Down Expand Up @@ -58,7 +58,7 @@ func TestRoleGet(t *testing.T) {
context.TODO(),
map[string]interface{}{},
accounts.RoleGetParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
AccountID: cloudflare.F("string"),
},
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmap.go
Expand Up @@ -58,7 +58,7 @@ func (r *AddressMapService) List(ctx context.Context, query AddressMapListParams
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/addressing/address_maps", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmapaccount.go
Expand Up @@ -37,7 +37,7 @@ func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID stri
opts = append(r.Options[:], opts...)
var env AddressMapAccountUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", params.AccountID, addressMapID, params.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmapip.go
Expand Up @@ -37,7 +37,7 @@ func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, i
opts = append(r.Options[:], opts...)
var env AddressMapIPUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", params.AccountID, addressMapID, ipAddress)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmapzone.go
Expand Up @@ -37,7 +37,7 @@ func (r *AddressMapZoneService) Update(ctx context.Context, addressMapID string,
opts = append(r.Options[:], opts...)
var env AddressMapZoneUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", params.AccountID, addressMapID, params.ZoneID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefix.go
Expand Up @@ -56,7 +56,7 @@ func (r *PrefixService) List(ctx context.Context, query PrefixListParams, opts .
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/addressing/prefixes", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixbgpbinding.go
Expand Up @@ -60,7 +60,7 @@ func (r *PrefixBGPBindingService) List(ctx context.Context, prefixID string, que
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings", query.AccountID, prefixID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixbgpprefix.go
Expand Up @@ -43,7 +43,7 @@ func (r *PrefixBGPPrefixService) List(ctx context.Context, prefixID string, quer
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes", query.AccountID, prefixID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixdelegation.go
Expand Up @@ -53,7 +53,7 @@ func (r *PrefixDelegationService) List(ctx context.Context, prefixID string, que
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", query.AccountID, prefixID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/service.go
Expand Up @@ -40,7 +40,7 @@ func (r *ServiceService) List(ctx context.Context, query ServiceListParams, opts
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/addressing/services", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion alerting/destinationwebhook.go
Expand Up @@ -68,7 +68,7 @@ func (r *DestinationWebhookService) List(ctx context.Context, query DestinationW
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion alerting/policy.go
Expand Up @@ -67,7 +67,7 @@ func (r *PolicyService) List(ctx context.Context, query PolicyListParams, opts .
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/alerting/v3/policies", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cache/cachereserve.go
Expand Up @@ -41,7 +41,7 @@ func (r *CacheReserveService) Clear(ctx context.Context, params CacheReserveClea
opts = append(r.Options[:], opts...)
var env CacheReserveClearResponseEnvelope
path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", params.ZoneID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion calls/call.go
Expand Up @@ -66,7 +66,7 @@ func (r *CallService) List(ctx context.Context, query CallListParams, opts ...op
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/calls/apps", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion custom_nameservers/customnameserver.go
Expand Up @@ -91,7 +91,7 @@ func (r *CustomNameserverService) Verify(ctx context.Context, params CustomNames
opts = append(r.Options[:], opts...)
var env CustomNameserverVerifyResponseEnvelope
path := fmt.Sprintf("accounts/%s/custom_ns/verify", params.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion dns/record.go
Expand Up @@ -183,7 +183,7 @@ func (r *RecordService) Scan(ctx context.Context, params RecordScanParams, opts
opts = append(r.Options[:], opts...)
var env RecordScanResponseEnvelope
path := fmt.Sprintf("zones/%s/dns_records/scan", params.ZoneID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion durable_objects/namespace.go
Expand Up @@ -39,7 +39,7 @@ func (r *NamespaceService) List(ctx context.Context, query NamespaceListParams,
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/workers/durable_objects/namespaces", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions email_routing/emailrouting.go
Expand Up @@ -44,7 +44,7 @@ func (r *EmailRoutingService) Disable(ctx context.Context, zoneIdentifier string
opts = append(r.Options[:], opts...)
var env EmailRoutingDisableResponseEnvelope
path := fmt.Sprintf("zones/%s/email/routing/disable", zoneIdentifier)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
if err != nil {
return
}
Expand All @@ -57,7 +57,7 @@ func (r *EmailRoutingService) Enable(ctx context.Context, zoneIdentifier string,
opts = append(r.Options[:], opts...)
var env EmailRoutingEnableResponseEnvelope
path := fmt.Sprintf("zones/%s/email/routing/enable", zoneIdentifier)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion hyperdrive/config.go
Expand Up @@ -66,7 +66,7 @@ func (r *ConfigService) List(ctx context.Context, query ConfigListParams, opts .
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/hyperdrive/configs", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion intel/indicatorfeed.go
Expand Up @@ -68,7 +68,7 @@ func (r *IndicatorFeedService) List(ctx context.Context, query IndicatorFeedList
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/intel/indicator-feeds", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion intel/sinkhole.go
Expand Up @@ -38,7 +38,7 @@ func (r *SinkholeService) List(ctx context.Context, query SinkholeListParams, op
opts = append(r.Options, opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := fmt.Sprintf("accounts/%s/intel/sinkholes", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
Expand Down
3 changes: 3 additions & 0 deletions internal/apijson/encoder.go
Expand Up @@ -359,6 +359,9 @@ func (e *encoder) encodeMapEntries(json []byte, v reflect.Value) ([]byte, error)
if err != nil {
return nil, err
}
if len(encodedValue) == 0 {
continue
}
json, err = sjson.SetRawBytes(json, string(p.key), encodedValue)
if err != nil {
return nil, err
Expand Down

0 comments on commit e1ec709

Please sign in to comment.