to the user API. # users action [/users] ## Create user [POST] ## Get users [GET] # user action [/users/{id}] ## Get user [GET] ## Update user [PUT] ## Delete user [DELETE] # Data Structures ## users (object)
• ఏڙ͢Δαʔόʔͷϗετهड़Մೳ FORMAT: 1A HOST: http://localhost:3000 # user API Welcome to the user API. # users action [/users] ## Create user [POST] ## Get users [GET] # user action [/users/{id}] ## Get user [GET] ## Update user [PUT] ## Delete user [DELETE] # Data Structures ## users (object)
• ԼʹAPIશମͷઆ໌͕ॻ͚Δ FORMAT: 1A HOST: http://localhost:3000 # user API Welcome to the user API. # users action [/users] ## Create user [POST] ## Get users [GET] # user action [/users/{id}] ## Get user [GET] ## Update user [PUT] ## Delete user [DELETE] # Data Structures ## users (object)
FORMAT: 1A HOST: http://localhost:3000 # user API Welcome to the user API. # users action [/users] ## Create user [POST] ## Get users [GET] # user action [/users/{id}] ## Get user [GET] ## Update user [PUT] ## Delete user [DELETE] # Data Structures ## users (object)
id: `1` (enum[string]) - The ID of the desired user. + Members + `1` + `2` + `3` ## Get user [GET] • parameter͕͋Δ߹ॳΊʹ+parameterΛఆٛ͢Δͱ Ҏ߱ͷϦΫΤετશͯͰར༻ग़དྷΔ • ࠓճMembersΛड͚ೖΕΔ༷ʹ͕ͨ͠ଞʹॳظ requiredઃఆͰ͖Δ
Parameters + id: `1` (enum[string]) - The ID of the desired user. + Members + `1` + `2` + `3` ## Get user [GET] Returns user. + Response 200 (application/json; charset=utf-8) + Attributes (users)
response_stash = {} after "users action > Create user" do |transaction| # saving HTTP response to the stash response_stash[transaction['name']] = transaction['real'] end
previous response here parsed_body = JSON.parse response_stash['users action > Create user'] ['body'] machine_id = parsed_body['id'] #replacing id in URL with stashed id from previous response transaction['fullPath'].gsub! '1', machine_id.to_s end
user" do |transaction| get_input(transaction, response_stash) end before "user action > Update user" do |transaction| get_input(transaction, response_stash) end before "user action > Delete user" do |transaction| get_input(transaction, response_stash) end
response_stash) #reusing data from previous response here parsed_body = JSON.parse response_stash['users action > Create user']['body'] machine_id = parsed_body['id'] #replacing id in URL with stashed id from previous response transaction['fullPath'].gsub! '1', machine_id.to_s end after "users action > Create user" do |transaction| # saving HTTP response to the stash response_stash[transaction['name']] = transaction['real'] end before "user action > Get user" do |transaction| get_input(transaction, response_stash) end before "user action > Update user" do |transaction| get_input(transaction, response_stash) end before "user action > Delete user" do |transaction| get_input(transaction, response_stash) end
init ? Location of the API blueprint (apiary.apib) user.apib ? Command to start API backend server e.g. (bundle exec rails server) rails server -b 0.0.0.0 ? URL of tested API endpoint http://localhost:3000 ? Programming language of hooks ruby ? Do you want to use Apiary test inspector? (Y/n)
failing, 0 errors, 0 skipped, 5 total complete: Tests took 2173ms complete: See results in Apiary at: https://app.apiary.io/public/ tests/run/f961c845-e6c6-4020-9d06-5c5545841b16 info: Sending SIGTERM to the backend server - Gracefully stopping, waiting for requests to finish === puma shutdown: 2016-05-10 21:04:36 +0900 === - Goodbye! Exiting