William Cheng df10c725ab
Add lua test script, minor fix to Lua API files (#7490)
* add lua test script, minor fix to api files

* fix model import, avoid null header issue

* add space before equal sign
2018-01-25 22:01:04 +08:00

13 lines
383 B
Lua

local petstore_client = require "petstore.api.pet_api"
local petstore_client_pet = require "petstore.model.pet"
local my_pet_http_api = petstore_client.new("petstore.swagger.io", "/v2", {"http"})
local my_pet = my_pet_http_api:get_pet_by_id(5)
for k,v in pairs(my_pet) do
print(k,v)
end
local my_new_pet = petstore_client_pet.new("Mr. Barks")
my_pet_http_api:add_pet(my_new_pet)