Always return an objects array in /roulette.json #52

Open
dice wants to merge 1 commit from dice/roulette-empty-objects into main AGit
Contributor

A bare pet used to omit the objects key from the JSON, so callers had to special-case it. The JSON now always has objects, as an empty array when there are no items. Only the JSON body changes; the wardrobe and PNG URLs still leave objects out, since an empty array in a query string would add a stray objects[]= param.

A bare pet used to omit the objects key from the JSON, so callers had to special-case it. The JSON now always has objects, as an empty array when there are no items. Only the JSON body changes; the wardrobe and PNG URLs still leave objects out, since an empty array in a query string would add a stray objects[]= param.
Always return an objects array in /roulette.json
All checks were successful
CI / rspec (pull_request) Successful in 2m4s
CI / deploy (pull_request) Has been skipped
8f0f55ed55
A bare pet used to omit the key entirely, so callers had to special-case
it. The JSON now has an empty array instead. The wardrobe and PNG URLs
are unchanged and still leave objects out.
Owner

@dice I think this is actually nudging me toward a different answer: the roulette is functionally generating an unsaved outfit, and we already have JSON serialization for that. Might set up a PR to start giving you that instead—which would be a minor JSON format change.

@dice I think this is actually nudging me toward a different answer: the roulette is functionally generating an _unsaved outfit_, and we already have JSON serialization for that. Might set up a PR to start giving you that instead—which would be a minor JSON format change.
All checks were successful
CI / rspec (pull_request) Successful in 2m4s
Required
Details
CI / deploy (pull_request) Has been skipped
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/52/head:dice/roulette-empty-objects'
git switch 'dice/roulette-empty-objects'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpenNeo/impress!52
No description provided.