Add "num_usable_bikes" and "num_usable_spaces" to station_status.json #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change tries to fix the limitation the current spec has, where it's not possible to know how many bikes are there at a station when
is_renting = 0
.In my opinion, as exposed in issue #94,
is_renting
should be independent tonum_bikes_available
. In the same way,is_returning
should be independent tonum_docks_available
.Because changing the spec would break existing clients implementing it, I propose adding
num_usable_bikes
andnum_usable_spaces
to the spec.These two new fields, in conjunction with
is_renting
andis_returning
, arguably makenum_bikes_available
andnum_docks_available
redundant, but keeping them guarantees backward compatibility.What we achieve with this spec change is to know how many bikes and spaces there are in a station regardless of the
is_renting
andis_returning
flag.This allows clients to: