I suggest you ...

Group resource by request

When you create something like this.

GET /payment/{id}
< 200
{
"type" : "templated"
}

GET /payment/123
< 200
{
"type" : "special case, matched without a template"
}

It'' be great if the get grouped when you see the documentation.

Just one resource /payment/{id}, the other one is just an example for the mock api server..

thanks

3 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Juan Ignacio DonosoJuan Ignacio Donoso shared this idea  ·   ·  Admin →
    declined  ·  ZZ responded  · 

    Dear Juan,
    I am afraid this would not be feasible approach. Please consider following:

    Returns payment for given id (id can be for example = abcdef1234)
    GET /payment{/id}

    and:

    Returns total number of all payments made.
    GET /payment/count

    There is not enough information to guess whether count is a value of {id} or something else.

    Luckily, if specifying default value is what you are looking for, the New API Blueprint Format will bring support for specifying default values for URI parameters so you would be able to write something like:

    1. GET /payment{/id}
      1. Parameters
        + id = 123 … An id of a payment to get.

    With this I am closing this idea. Please let me know (z@apiary.io) if specifying default value is what you need or want to discuss this topic in detail.

    Thank you.

    With kind regards,

    – Z.

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base