Plaintext value is empty using the API

When I make an API request and limit the return fields with fields, the plaintext value is empty.


It does return the value if I removed the fields parameters.


Ghost Version 3.1.0

Is there anything I’m missing?


Any thoughts about this?

Just did a quick check for this and it all worked as expected for v3 Content API (note you have v2 on both of your screenshots)
Was verifying the output with the following test (added it to this suite):

    it('posts with plaintext field', function () {
        return request
            .set('Origin', testUtils.API.getURL())
            .expect('Content-Type', /json/)
            .expect('Cache-Control', testUtils.cacheRules.private)
            .then((res) => {
                localUtils.API.checkResponse(res.body.posts[0], 'post', null, null, ['id', 'title', 'plaintext']);

I tried this on the latest master.

Anything specific about the html content in posts missing the plaintext? Can’t really think of why this would not work :slight_smile:

Yes, tried it with the v3 and it is not working too.

Also, if I removed formats=plaintext and only provides the fields, plaintext and html are also empty.


If I want to return only the id and html for example, the html is empty.


It’s pretty hard to pinpoint the issue here :thinking: Could you try doing similar request on a new instance and if it does’t happen they try to import some of the data from your current instance?
My current thinking is:

  1. It might be something with the data
  2. There were some modifications in the code itself (did you do anything custom?
  3. Maybe something database specific? Which version are you running? Is it MySQL or SQLite?

Would be helpful if you could provide more information about the environment the instance is running in. Also try running the request using plain curl, so we can eliminate browser extension doing something strange.