pyramid-jsonapi icon indicating copy to clipboard operation
pyramid-jsonapi copied to clipboard

Ignored columns are not ignored when included through &include=true

Open kenneaal opened this issue 6 years ago • 2 comments

Hidden columns (through adding .info.update({'pyramid_jsonapi': {'visible': False}}) to the model) are not properly hidden if a relation exists to another model with hidden columns.

Reproduction:

Create two models: class One(Base): id = Column(Integer, primary_key=True) twoId = Column(Integer, ForeignKey('two.id') hiddenColumn = Column(Text) hiddenColumn.info.update({'pyramid_jsonapi': {'visible': False}})

class Two(Base): id = Column(Integer, primary_key=True) oneId = Column(Integer, ForeignKey('one.id') hiddenColumn = Column(Text) hiddenColumn.info.update({'pyramid_jsonapi': {'visible': False}})

Fill with appropriate data. Access One through the endpoint and add &include=two to query to include data from Two. hiddenColumn data from Two will be included even though it is hidden.

kenneaal avatar Apr 23 '18 20:04 kenneaal

Noted and good catch.

I can see where this would happen. I'll see if I can fix it soon (conferencing today though so probably next week).

colinhiggs avatar Apr 27 '18 09:04 colinhiggs

Any update on this issue?

kenneaal avatar May 22 '18 06:05 kenneaal