Skip to content

How to hide relation API endpoints from explorer? ex. GET /parents/{pk}/childs #563

Description

@veekungx

I have two models Parent and Child and relation like this.

Parent --> hasAndBelongsToMany --> Child
Child --> hasAndBelongsToMany --> Parent

and I got

GET /Parents/{id}/students
GET /Parents/{id}/students/{pk}
GET /Parents/{id}/students/rel/{pk}
... etc.

I can hide GET /parents with.

Parent.sharedClass.find('find', true).shared = false;

How about relations to child model the code below not working?

 Parent.sharedClass.find('__get__students', true).shared = false;

OR

 Parent.sharedClass.find('__get__students', false).shared = false;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions