Skip to content

feat: Header to render only specific bones in the json renderer - #1376

Closed
ArneGudermann wants to merge 3 commits into
viur-framework:3.6from
ArneGudermann:feat/header_boneList
Closed

ArneGudermann wants to merge 3 commits into
viur-framework:3.6from
ArneGudermann:feat/header_boneList

Conversation

@ArneGudermann

Copy link
Copy Markdown
Contributor

This PR adds a check for a Header Field x-viur-bonelist. The names of the bones to be rendered can be entered in this field.

@ArneGudermann ArneGudermann added feature New feature or request Priority: High After critical issues are fixed, these should be dealt with before any further issues. labels Jan 22, 2025
@ArneGudermann ArneGudermann added this to the ViUR-core v3.6 milestone Jan 22, 2025

@phorward phorward left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my suggestion would be the following:

  • Evaluate an x-viur-bonelist in the viewSkel and create a dynamic SubSkel based on it
  • The SubSkel is then integrated into the normal process in ViUR, data is retrieved with it and it only ever affects the bones that are in the subskel
  • Nothing has to be adapted to any renderers
  • If this works well, it could be extended to the BaseBone() as a general option.

Dynamic SubSkels are only available from viur-core 3.7 and I'm not patching that down to 3.6.

Comment thread src/viur/core/request.py
phorward added a commit to phorward/viur-core that referenced this pull request Jan 23, 2025
- Introduces generic `SkelModule.skel()` function to obtain a skeleton instance.
- Modifies all prototypes to accept `bones_from_request`

Replacement for viur-framework#1376
@sveneberth

Copy link
Copy Markdown
Member

I am completely on @phorward's side.

A renderer should transform data into a desired format. But it should not apply any logic to this data, except that which concerns the output format. Reducing or expanding the data does not belong in there, but in the module.
In addition, data should be filtered out as early as possible in order to be as efficient as possible for further processing.

phorward added a commit to phorward/viur-core that referenced this pull request Feb 3, 2025
- Introduces generic `SkelModule.skel()` function to obtain a skeleton instance.
- Modifies all prototypes to accept `bones_from_request`

Replacement for viur-framework#1376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request Priority: High After critical issues are fixed, these should be dealt with before any further issues.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants