You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's multiple things going on here, and it's a little confusing. First off, we already have a way to add extra parameters that don't normally come back from a payload, but description should come back by default. Can you show what APi call you're making where it doesn't return the values you're expecting? That is where are you seeing this:
The "All Tags" tab in the UI showed "-" for tag descriptions because the categories tags subcollection API did not return the description attribute.
Hi @Fryguy ,
Thanks for the review.
The UI is using: GET /api/categories?expand=resources,tags&attributes=id,name,description,single_value,show,default,perf_by_tag&tag_attributes=id,name,description,categorization
The issue is with the nested tags returned in the expanded tags subcollection.
For example, the category resource includes its description, but the tag resources only return attributes such as id, name, href and id_value. The requested tag description is not present in the response, which causes the UI to display "-" in the All Tags tab.
The UI is explicitly requesting tag descriptions through:
tag_attributes=id,name,description,categorization
but description is not included in the returned tag objects.
This PR adds support for returning the requested description attribute for tags in the expanded categories tags subcollection.
Regarding overlap with @jrafanie's work, I'm happy to align if there is already a generic solution for subcollection attributes. Please let me know if this should be folded into that effort instead.
Friendly ping on this PR. I've addressed the review comments and added details about the API call and expected response.
Please let me know if any further changes are needed. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Tag description missing from /api/categories tags subcollection
Problem
The "All Tags" tab in the UI showed "-" for tag descriptions because the
categories tags subcollection API did not return the
descriptionattribute.Root Cause
tag_attributesquery parameter was not supported by the categoriestags subcollection endpoint.
Fix
app/controllers/api/subcollections/tags.rbtag_attributesquery parameterdescription, in the tagssubcollection response
API Usage