Open matin opened 10 years ago
iirc when we redid the scenarios using cukes, we chose to use the ids instead as it made it easier to read.
This was compared to the yaml scenarios which did not have urls all over the scenarios since they were extrapolating from the hypermedia, and therefore somewhat confusing/hard to read
I did it because our documentation specifically suggests URLs and IDs, so I had to make sure we covered those cases.
But we should have URL ones, too.
@steveklabnik Should we use the two styles interchangeably in the scenarios?
If we want to be truly exhaustive, we'd do both, because we want people to use hrefs, but also suggest they use ids.
:/
Let's switch to using HREFs as we refactor. I'm worried about using IDs for the same reason we ask customers not to do so: it's prone to typos.
Seems good. We should consider how we document all our endpoints, though...
We should consider how we document all our endpoints, though...
What do you mean?
Well, take https://docs.balancedpayments.com/1.1/api/cards/#fetch-a-card
This tells people to GET https://api.balancedpayments.com/cards/:card_id
. So of course, they're going to use the ID, rather than an href from a previous response.
Step definitions currently look like this:
It's referenced like this:
When I POST to /cards/:debit_card_id/credits with the JSON API body:
It should instead be:
and
When I POST to :debit_card_href/credits with the JSON API body: