Skip to content

Cannot define default projection and request specific field #1036

Description

@Hugoch

Hi,

I am trying to exclude a field from a specific endpoint when requesting /endpoint. I use

'datasource': {
            'projection': {
                'my_field_to_exclude': 0,
            }
        },

which works well. I can get the field on demand via /endpoint?projection={"my_field_to_exclude":1} (similar to http://python-eve.org/features.html#projection-filestorage).

However I want to be able to query the endpoint for a given field with /endpoint?projection={"another_field":1}. I expect to get a response with another_field only but I only get

<link rel="collection" href="endpoint" title="mycollection"/>
<link rel="parent" href="/" title="home"/>
<_created>1970-01-01T00:00:00.000</_created>
<_etag>ce526180ec8bf46972f44049d7db1eaf25cca381</_etag>
<_id>731730</_id>
<_updated>1970-01-01T00:00:00.000</_updated>

If I remove the datasource projection, the field appears.

Any ideas ? I am missing anything ?

Thx !

Using Eve-0.7.4.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions