Open m33ch opened 9 years ago
Hey @m33ch, Unfortunately, you are missing something in the doc.json
which is being incompatible with the api.json
. I am planning to improve the error handling though.
Hi @pksunkara,
thank you for your reply.
This is my api.json
{ "base":"http://local.dev", "version":"1", "authorization":{ "need_auth":true, "header":true }, "request":{ "formats":{ "default":"json", "form":false, "json":true } }, "response":{ "formats":{ "default":"json", "json":true }, "suffix":true }, "error":{ "message":"error" }, "classes":[ { "name":"discounts", "args":[ "id" ], "functions":[ { "name":"index", "method":"get", "path":"/discounts" }, { "name":"show", "method":"get", "path":"/discounts/:id" }, { "name":"store", "path":"/discounts/", "method":"post", "params":[ { "name":"name", "required":true }, { "name":"value" }, { "name":"value_type" }, { "name":"status" } ] }, { "name":"update", "path":"/discounts/:id", "method":"post", "params":[ { "name":"name", "required":true }, { "name":"value" }, { "name":"value_type" }, { "name":"status" } ] }, { "name":"destroy", "method":"delete", "path":"/discounts/:id" } ] } ] }
And this is doc.json
{ "discounts":{ "title":"Discount", "desc":"Returns discount api instance", "args":{ "id":{ "desc":"Id of discount", "value":"1" } }, "functions" : { "index":{ "title":"Get user discounts", "desc":"Retrieve created user discounts" }, "store":{ "title":"Create new discount", "desc":"Create new discount", "params":{ "name":{ "desc":"Name on discount", "value":"Sold Out 50%!" }, "value":{ "desc":"Value of discount", "value":"20" }, "value_type":{ "desc":"Type of discount : absolute or percentage", "value":"absolute" }, "status":{ "desc":"Active discount? (enabled, disabled)", "value":"disabled" } } }, "show":{ "title":"Get a user discount", "desc":"Retrieve one discount" }, "destroy":{ "title":"Delete a user discount", "desc":"Delete one discount" } } } }
That json files are created based on your example.
Thank you very much!
Also having this same issue with both of the examples provided in this repo.
alpaca ~/alpaca/examples/helpful/
panic: interface conversion: interface is nil, not map[string]interface {}
goroutine 1 [running]:
runtime.panic(0x6ff260, 0xc2100bcac0)
/usr/local/lib/gvm/gos/go1.2/src/pkg/runtime/panic.c:266 +0xb6
Hi,
thank you for this package.
I got an error when i try to generate a php api. This is error
Thank you