Update serpAPIKnowledge struct to allow flexible type for 'Type' field
- Modified the 'Type' field in the serpAPIKnowledge struct to use an interface{}, enabling it to accept either a string or an object based on the query context.
- This change enhances the flexibility of the knowledge graph data representation in the search handler.
This commit is contained in:
parent
324ee7dc92
commit
8dcb78fc37
1 changed files with 3 additions and 3 deletions
|
|
@ -115,9 +115,9 @@ type serpAPIAnswerBox struct {
|
|||
|
||||
// serpAPIKnowledge represents knowledge graph data
|
||||
type serpAPIKnowledge struct {
|
||||
Title string `json:"title,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Type interface{} `json:"type,omitempty"` // Can be string or object depending on query
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// serpAPIRelated represents related searches
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue