diff --git a/internal/proxy/templates/proxy/strict/strict-interface.tmpl b/internal/proxy/templates/proxy/strict/strict-interface.tmpl index 0241679..a56c9cd 100644 --- a/internal/proxy/templates/proxy/strict/strict-interface.tmpl +++ b/internal/proxy/templates/proxy/strict/strict-interface.tmpl @@ -62,11 +62,13 @@ func (s StrictOperationsMap[T]) ToMap() (m map[string]T) { {{ writeExtensionType . "StrictExtensionsStruct" }} type StrictOperationsDataStruct struct { + Path string Extension StrictExtensionsStruct } var StrictOperationsData = func() (m StrictOperationsMap[StrictOperationsDataStruct]) { {{- range .}} { + m.{{.OperationId}}.Path = `{{.Path}}` b := []byte({{ writeExtensionData . }}) if err := json.Unmarshal(b, &m.{{.OperationId}}.Extension); err != nil { panic(err) diff --git a/internal/proxy/testoutput/oapi-proxy.go b/internal/proxy/testoutput/oapi-proxy.go index 9ec7835..df990d9 100644 --- a/internal/proxy/testoutput/oapi-proxy.go +++ b/internal/proxy/testoutput/oapi-proxy.go @@ -354,29 +354,34 @@ type StrictExtensionsStruct struct { } type StrictOperationsDataStruct struct { + Path string Extension StrictExtensionsStruct } var StrictOperationsData = func() (m StrictOperationsMap[StrictOperationsDataStruct]) { { + m.GetProfile.Path = `/profiles/{profile-id}` b := []byte("{\"proxy\":{\"inject\":{\"parameters\":[{\"in\":\"path\",\"name\":\"tenant-id\"}]},\"method\":\"get\",\"name\":\"profile\",\"path\":\"/tenants/{tenant-id}/profiles/{profile-id}\"}}") if err := json.Unmarshal(b, &m.GetProfile.Extension); err != nil { panic(err) } } { + m.PutProfile.Path = `/profiles/{profile-id}` b := []byte("{\"proxy\":{\"inject\":{\"parameters\":[{\"in\":\"path\",\"name\":\"tenant-id\"}]},\"method\":\"put\",\"name\":\"profile\",\"path\":\"/tenants/{tenant-id}/profiles/{profile-id}\"}}") if err := json.Unmarshal(b, &m.PutProfile.Extension); err != nil { panic(err) } } { + m.ProfileGetProfile.Path = `/tenants/{tenant-id}/profiles/{profile-id}` b := []byte("{\"proxy\":{\"name\":\"profile\"}}") if err := json.Unmarshal(b, &m.ProfileGetProfile.Extension); err != nil { panic(err) } } { + m.GetValidatedProfile.Path = `/validated-profiles/{profile-id}` b := []byte("{\"proxy\":{\"inject\":{\"parameters\":[{\"in\":\"path\",\"name\":\"tenant-id\"}]},\"method\":\"get\",\"name\":\"profile\",\"path\":\"/tenants/{tenant-id}/profiles/{profile-id}\"}}") if err := json.Unmarshal(b, &m.GetValidatedProfile.Extension); err != nil { panic(err)