Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes null links from pagination #2294

Closed
wants to merge 1 commit into from
Closed

Removes null links from pagination #2294

wants to merge 1 commit into from

Conversation

langalex
Copy link

Purpose

Become (more) compliant with JSON-API.

Changes

Remove null links from pagination.

Caveats

None.

Related GitHub issues

None.

Additional helpful information

I ran the pagination links generated by active_model_serializers against the JSON-API spec, and it turns out links must not be null. See also the schema. Only strings and objects are allowed.

according to the json-api spec (json-schema file), links must not be null
@bf4
Copy link
Member

bf4 commented Oct 19, 2018

@langalex Thanks for the issue

The behavior of AMS is actually correct. You linked to document links. If you scroll down to https://jsonapi.org/format/#fetching-pagination you'll see that null is allowed.

In addition, the schema is not authoritative.

@bf4 bf4 closed this Oct 19, 2018
@langalex
Copy link
Author

Ok sorry about that. I ran the responses of my tails API tests against the schema and that failed, so I guess the schema is wrong in this case. Do you have any idea how much sense it would make to try to get it updated?

@langalex
Copy link
Author

Never mind. I'll do some proper research before asking any more uninformed questions.

@bf4
Copy link
Member

bf4 commented Oct 19, 2018

@langalex No need to be hard on yourself. You're asking the same questions I and many others have asked :)

@langalex
Copy link
Author

Turns out the schema does in fact not allow null links even though it probably should. But there's already an issue for that

@langalex langalex deleted the no-null-links branch October 20, 2018 14:19
@bf4
Copy link
Member

bf4 commented Oct 22, 2018

see #2224
and #1668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants