Closed cedricbonhomme closed 3 years ago
So actually the migration consist of this.
I removed _max_results_perpage, _results_perpage and _excludecolumns. :-( I will find replacement for these features later.
Hi,
when you register a model in the API manager it creates a serializer for it, which is later used for both serializing full objects and relationships. So you do need to register all models that you want to expose directly or via relationships.
Also, from JSON API standpoint it is expected to be able to fetch a resource listed in relationships.
If you do not want to expose some resources at all, you should add that relationship field into exclude
parameter when registering the parent model. That way it will not appear in relationships
thanks, I'll test this !
I am migrating a Flask app I am working on since some years.
I defined a blueprint as explained in the documentation: https://github.com/CASES-LU/MOSP/blob/flask-restless-ng/mosp/web/views/api/v1/jsonobject.py#L41 (three in reality)
then I register the blueprints: https://github.com/CASES-LU/MOSP/blob/flask-restless-ng/runserver.py#L36-L38
When I query an endpoint I always get:
And if I do this: https://github.com/CASES-LU/MOSP/blob/flask-restless-ng/mosp/web/views/api/v1/jsonobject.py#L59
I will get the same error message but for a kind of object not exposed (directly) by the API. It's on a relationship of the object supposed to be exposed by the API.
It would be nice if you have an idea. Let me know if you need more information.
I have some few projects to migrate, like https://open-source-security-software.net/ which is relying a lot on Flask-Restless.
By the way, with the latest versions of Flask and Flask-SQLAlchemy (https://github.com/CASES-LU/MOSP/blob/master/poetry.lock) I still have no issues with Flask-Restless.