chore: version bump and test API update

This commit is contained in:
Cristian Vidmar 2022-10-13 09:58:20 +02:00
parent e16de9fc8d
commit 1671d0187a
7 changed files with 35 additions and 31 deletions

View File

@ -14,7 +14,7 @@ import (
"github.com/foomo/gocontentful/erm"
)
var VERSION = "v1.0.14"
var VERSION = "v1.0.15"
type contentfulRc struct {
ManagementToken string `json:"managementToken"`

View File

@ -1,4 +1,4 @@
// Code generated by https://github.com/foomo/gocontentful v1.0.14 - DO NOT EDIT.
// Code generated by https://github.com/foomo/gocontentful v1.0.15 - DO NOT EDIT.
package testapi
import (

View File

@ -1,4 +1,4 @@
// Code generated by https://github.com/foomo/gocontentful v1.0.14 - DO NOT EDIT.
// Code generated by https://github.com/foomo/gocontentful v1.0.15 - DO NOT EDIT.
package testapi
import "github.com/foomo/contentful"

View File

@ -1,4 +1,4 @@
// Code generated by https://github.com/foomo/gocontentful v1.0.14 - DO NOT EDIT.
// Code generated by https://github.com/foomo/gocontentful v1.0.15 - DO NOT EDIT.
package testapi
import (
@ -1308,37 +1308,41 @@ func (n *RichTextGenericNode) richTextRenderHTML(w io.Writer, linkResolver LinkR
case RichTextNodeText:
tags = []richTextHtmlTag{}
case RichTextNodeHyperlink:
uri := n.Data["uri"]
attrs := map[string]string{}
switch uriString := uri.(type) {
case string:
if uriString != "" {
resolvedAttrs, errResolveAttrs := linkResolver(uriString)
if errResolveAttrs != nil {
err = errResolveAttrs
return
if n.Data != nil {
uri := n.Data["uri"]
attrs := map[string]string{}
switch uriString := uri.(type) {
case string:
if uriString != "" {
resolvedAttrs, errResolveAttrs := linkResolver(uriString)
if errResolveAttrs != nil {
err = errResolveAttrs
return
}
attrs = resolvedAttrs
}
attrs = resolvedAttrs
}
tags = []richTextHtmlTag{richTextHtmlTag{name: HtmlAnchor, attrs: attrs}}
}
tags = []richTextHtmlTag{richTextHtmlTag{name: HtmlAnchor, attrs: attrs}}
case RichTextNodeEntryHyperlink:
target := n.Data["target"]
attrs := map[string]string{}
switch target.(type) {
case map[string]interface{}:
targetSys, ok := target.(map[string]interface{})["sys"]
if ok {
entryID := targetSys.(map[string]interface{})["id"].(string)
resolvedAttrs, errResolveAttrs := entryLinkResolver(entryID, locale)
if errResolveAttrs != nil {
err = errResolveAttrs
return
if n.Data != nil {
target := n.Data["target"]
attrs := map[string]string{}
switch target.(type) {
case map[string]interface{}:
targetSys, ok := target.(map[string]interface{})["sys"]
if ok {
entryID := targetSys.(map[string]interface{})["id"].(string)
resolvedAttrs, errResolveAttrs := entryLinkResolver(entryID, locale)
if errResolveAttrs != nil {
err = errResolveAttrs
return
}
attrs = resolvedAttrs
}
attrs = resolvedAttrs
}
tags = []richTextHtmlTag{richTextHtmlTag{name: HtmlAnchor, attrs: attrs}}
}
tags = []richTextHtmlTag{richTextHtmlTag{name: HtmlAnchor, attrs: attrs}}
case RichTextNodeEmbeddedAsset:
if imageResolver == nil {
return errors.New("can't resolve image asset URL")

View File

@ -1,4 +1,4 @@
// Code generated by https://github.com/foomo/gocontentful v1.0.14 - DO NOT EDIT.
// Code generated by https://github.com/foomo/gocontentful v1.0.15 - DO NOT EDIT.
package testapi
import (

View File

@ -1,4 +1,4 @@
// Code generated by https://github.com/foomo/gocontentful v1.0.14 - DO NOT EDIT.
// Code generated by https://github.com/foomo/gocontentful v1.0.15 - DO NOT EDIT.
package testapi
import (

View File

@ -1,4 +1,4 @@
// Code generated by https://github.com/foomo/gocontentful v1.0.14 - DO NOT EDIT.
// Code generated by https://github.com/foomo/gocontentful v1.0.15 - DO NOT EDIT.
package testapi
import (