Due to update in oapi-codegen it appears it generates different methods/funcs, but tested the provider for manufacturers and it works, not sure if something broke.

main
Mikhail Yohman 2023-03-28 18:59:09 -06:00
parent 315bd8d536
commit 2be79dd3a0
No known key found for this signature in database
GPG Key ID: B317161F0F35E82A
3 changed files with 5 additions and 5 deletions

View File

@ -34,8 +34,8 @@ get-api:
cd client; wget https://demo.nautobot.com/api/swagger.yaml\?api_version\=1.3 -O swagger.yaml cd client; wget https://demo.nautobot.com/api/swagger.yaml\?api_version\=1.3 -O swagger.yaml
generate: get-api generate: get-api
cd client; oapi-codegen -generate client -o nautobot.go -package nautobot test.swagger.yaml && \ cd client; oapi-codegen -generate client -o nautobot.go -package nautobot swagger.yaml && \
oapi-codegen -generate types -o types.go -package nautobot test.swagger.yaml && \ oapi-codegen -generate types -o types.go -package nautobot swagger.yaml && \
go mod tidy go mod tidy
test: test:

View File

@ -43,7 +43,7 @@ type Site struct {
ContactName *string `json:"contact_name,omitempty"` ContactName *string `json:"contact_name,omitempty"`
ContactPhone *string `json:"contact_phone,omitempty"` ContactPhone *string `json:"contact_phone,omitempty"`
Created *types.Date `json:"created,omitempty"` Created *types.Date `json:"created,omitempty"`
CustomFields *nb.Site_CustomFields `json:"custom_fields,omitempty"` CustomFields *nb.CustomFieldChoice `json:"custom_fields,omitempty"`
Description *string `json:"description,omitempty"` Description *string `json:"description,omitempty"`
DeviceCount *int `json:"device_count,omitempty"` DeviceCount *int `json:"device_count,omitempty"`

View File

@ -102,7 +102,7 @@ func resourceManufacturerCreate(ctx context.Context, d *schema.ResourceData, met
c := meta.(*apiClient).Client c := meta.(*apiClient).Client
s := meta.(*apiClient).Server s := meta.(*apiClient).Server
var m nb.Manufacturer var m nb.ManufacturerRequest
name, ok := d.GetOk("name") name, ok := d.GetOk("name")
n := name.(string) n := name.(string)
@ -243,7 +243,7 @@ func resourceManufacturerUpdate(ctx context.Context, d *schema.ResourceData, met
name := d.Get("name").(string) name := d.Get("name").(string)
id := d.Get("id").(string) id := d.Get("id").(string)
var m nb.PatchedManufacturer var m nb.PatchedManufacturerRequest
if d.HasChange("name") { if d.HasChange("name") {
m.Name = &name m.Name = &name