Giter Site home page Giter Site logo

contentful-go's People

Contributors

axe312ger avatar cakejelly avatar dstrelau avatar hooloovooo avatar khaledgarbaya avatar marwan-at-work avatar monicatie avatar mrbenosborne avatar ohookins avatar philipithomas avatar skrabacz-michal avatar stefanjudis avatar tolgaio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

contentful-go's Issues

Allowing specifying HTTP client instance used

I'm currently trying to implement some tests in my code base which uses the contentful-go client but due to not being able to specify the HTTP client it makes testing very difficult. I'm opening a PR that exposes the HTTP client so consumers can set it.

Example to retrieve the content of a specified content-type

Could someone post an example of retreiving the actual data from a content-type. (i.e.: I have a content-type of 'product' and I want to get a complete list of the content that I have created for that content-type. I am looking at using this SDK not the API directly.

Thanks!

Installation using go get fails

The README.md states that you should install the SDK using the command:

$ go get -u github.com/tolgaakyuz/contentful.go
stat github.com/tolgaakyuz/contentful.go: no such file or directory

However this fails. Please improve your burkish SDK.

CDA improvements

  • Link resolution
  • Api URL
  • Image API Helpers (for building URL)
  • Think about separating models for CDA and CMA
  • Maybe generalising

Setting QueryParams on Entries.List(space)

Setting the QueryParams on Entries.List(space) seems to crash the application. It also looks like it's not passing on the query parameters in the request. Is this planned on being supported?

NewCDA points to non-existent cda.contentful.com

https://cda.contentful.com/spaces/: dial tcp: lookup cda.contentful.com on 10.0.0.10:53: no such host","level":"error"

I think the new CDA needs to be pointed at the cdn rather than the cda subdomain.

Missing entities

  • Environments
  • Editor Interfaces
  • Personal Access Token
  • Roles and permission
  • Snapshots support for content type and entry
  • SpaceMembership
  • UI Extension
  • Upload

Asset interface conversion

panic: interface conversion: interface {} is map[string]interface {}, not string

asset.go: 93

if err := json.Unmarshal([]byte(payload["sys"].(string)), asset.Sys); err != nil { return err }

Assets do not seem to support locales correctly

The assets that we are using have multiple locales, and whenever we try to func (service *AssetsService) Get OR func (service *AssetsService) List we get a a panic: interface conversion: interface {} is nil, not string.

We believe this is due to the types as defined below:

// FileFields model
type FileFields struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	File        *File  `json:"file,omitempty"`
}

// Asset model
type Asset struct {
	locale string
	Sys    *Sys        `json:"sys"`
	Fields *FileFields `json:"fields"`
}

whereas an example of the the json return from the get request is as follows:

{
  "sys": {...},
  "fields": {
    "title": {
      "en-GB": "..."
    },
    "description": {
      "en-GB": "..."
    },
    "file": {
      "en-GB": {...}
    }
  }
}

which would mean the assets would unmarshall into structs more like the below:

// FileFields model
type FileFields struct {
	Title       map[string]string `json:"title,omitempty"`
	Description map[string]string `json:"description,omitempty"`
	File        map[string]*File  `json:"file,omitempty"`
}

or similar.

We tried switching to single locale, and it still seems to have the same issue.

Documentation incorrect for released 0.4.0 version

Hi there,

Is it safe to use the master version from git?

We're using the 0.4.0 released version but there's been some significant developments (e.g. Environment use) which the docs point to but are inaccessible in the code.

Thanks

Project Status Check

Hey @tolgaakyuz! I'm considering using Contentful at my company, and I'm interested hearing how active this project is, and if there are major missing pieces of functionality between this and the python library. Thanks!

AssetsService issue. Endless recursion.

Recursive call at line 118 asset.go causes a stack overflow, I guess you need to unmarshal manually the json, since it's a custom handler.

func (asset *Asset) UnmarshalJSON(data []byte) error {
...
} else {
	if err := json.Unmarshal(data, asset); err != nil {
		return err
	}
}
...

Upload API and linking uploads to assets

Is it currently supported to use the upload api? You can find here in the docs the endpoint to which I'm referring: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads

It also seems like there isn't support for linking an upload to an asset. This is described in the "Associating an upload with an asset" section here: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads. More specifically the issue is that the uploadFromfield isn't present on the asset model.

Create new Entry

Hi, guys! Please, let me know a way how to create a new entry for exists content type, please. I went through source code but i can't find anything to do that.

Collection lacks ToEntry()

Collection has all the other type assertions, but lacks ToEntry(). Inlining the equivalent code achieves the desired effect, so I assume this is just a simple omission.

Testdata generation

Improve the testdata generation for test cases.

Some ideas

  • use golang templating
  • ues goreplay to capture real API data.

README example is incorrect

In the example we find:

collection := cma.ContentTypes.List(space.Sys.ID)
collection, err := collection.Next()
if err != nil {
  log.Fatal(err)
}

However the 2nd line here has no new variables left of :=

Cannot json Unmarshal on Assets

So basically after retrive the data from contentful and try to marshal it to string and unmarshal it into *contentful.Asset type. I got this error message:

panic: interface conversion: interface {} is map[string]interface {}, not string

Which then leads me to here

Any suggestion about it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.