Skip to content

Commit

Permalink
Fix not serializing PUT
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed Feb 24, 2025
1 parent e3cab0b commit 4d3d97e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ func determineCreateAndUpdateOperation(tok string, resource *resourceVariant) (*
if path.Put == nil {
return path.Patch, "PATCH", nil
}
return path.Put, "PUT", nil
return path.Put, "", nil
}

func (g *packageGenerator) genResourceVariant(apiSpec *openapi.ResourceSpec, resource *resourceVariant, nestedResourceBodyRefs []string, typeNameAliases ...string) error {
Expand Down
4 changes: 2 additions & 2 deletions provider/pkg/gen/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func TestDetermineUpdateOperation(t *testing.T) {
})
require.NoError(t, err)
assert.NotNil(t, op)
assert.Equal(t, "PUT", method)
assert.Equal(t, "", method)
})

t.Run("only PUT", func(t *testing.T) {
Expand All @@ -466,7 +466,7 @@ func TestDetermineUpdateOperation(t *testing.T) {
})
require.NoError(t, err)
assert.NotNil(t, op)
assert.Equal(t, "PUT", method)
assert.Equal(t, "", method)
})

t.Run("only PATCH", func(t *testing.T) {
Expand Down

0 comments on commit 4d3d97e

Please sign in to comment.