Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show only metadata_fields in GET content #1661

Open
razvanMiu opened this issue Jun 19, 2023 · 4 comments
Open

Show only metadata_fields in GET content #1661

razvanMiu opened this issue Jun 19, 2023 · 4 comments

Comments

@razvanMiu
Copy link
Contributor

There is no way to get only the desired metadatas in GET content

@davisagli
Copy link
Member

My initial reaction is that I would rather avoid adding this complexity unless there is a good reason. Why is it not good enough to only use the data you need from the response?

@razvanMiu
Copy link
Contributor Author

One example of usage is that we have blocks that can embed content from other pages and we want to get only some specific metadata. If we get everything the response would be too big, especially if those pages have a lot of blocks.
In my case I can avoid getting all the metadata field by making specific endpoints but I thought that making this generic would be useful.

@davisagli
Copy link
Member

davisagli commented Jun 20, 2023

Okay, that helps me understand the use case. I'll try to take a look at the PR soon and think about what would be the best way to do it. In terms of performance it would be best to use the summary serializer from catalog metadata so that it isn't necessary to load the full content object from the ZODB. I'm not sure if that belongs in the content GET service, or a new service. (It might be possible to get from the @querystring-search service already, using a path criterion with depth: 1 ... though, that would not handle well when content is moved to a new path... so, a UID criterion then)

@jensens
Copy link
Member

jensens commented Feb 6, 2024

My 0.02€...

  • If a block needs specific fields only, wouldn't it be better to request exact those fields instead of removing some fields?
  • Thinking about caching (Varnish, ...), GET parameters are not a good choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants