Conversation
This bug happens when I change to documentation tab, not only on db-connected services. Maybe this is a client bug. My workaround for now is force the #controllerType value to 'rest'. |
I have been unable to reproduce this -- switching between RPC and REST services, I've been able to update documentation without a problem.
If I can reproduce this, I'll work on a fix; in the meantime, if you can reliably reproduce it, keep tracing, and find out what is being stored for the API's |
Okay, reproduced here. Trying to work on a fix. |
Discovered the root cause of the problem: the API is creating the documentation relational links incorrectly, and using |
…names Originally, this looked for just namespaced segments (`Rest` and `Rpc`). However, with the changes made for 1.0.4 to remove encoded slashes from service names, this breaks link injection, as it could not identify a REST service by the namespace, and thus always identified services as RPC. The change introduced will now also detect when the service name contains dash-separated namespaces (`-Rest-`).
…names Originally, this looked for just namespaced segments (`Rest` and `Rpc`). However, with the changes made for 1.0.4 to remove encoded slashes from service names, this breaks link injection, as it could not identify a REST service by the namespace, and thus always identified services as RPC. The change introduced will now also detect when the service name contains dash-separated namespaces (`-Rest-`).
c4dbab4
to
db70c8f
Compare
Fixed. You can test it out by changing the "zf-apigility-admin" entry in your composer.json to use the version |
Fixed. I tested with rest and rpc services. |
Please update Apigility documentation "Creating a REST Service" https://www.apigility.org/documentation/intro/first-rest-service, the "Documentation" section didn't work due to this bug. Kind Regards, |
@jeboy There's no reason to update the documentation; this functionality worked prior to 1.0.4, and will work with the next release (or, if you're adventurous, with current master). @edipoReboucas Thanks for the verification! |
Thanks for the fix, I had tracked down the problem but luckily found this bug before creating a fix. I can confirm that this is fixed for me now that I've updated to 1.0.6. |
@weierophinney version |
I encounter this bug (on DB-connected service) :
The API documentation does not record, only the general description is recorded, collection entity, GET, POST, etc ... they are not recorded.
I have to write to the hands the file documentation.config.php but reading documentation its works.
If i change documentation with the admin interface, i lost the documentation, persists only the general description. This suggests to error when saving but no error in the logs files.
After looking at the source code and make some testing, the problem would be the parameter "$controllerType" in method "storeDocumentation" because "controllerType" take the value "RPC" while I save documention a "REST" service. So the method "getSchemaTemplate" does not return the correct documentation template and the method "storeDocumentation" does not correctly recorded documentation see "storeDocumentation" (array_intersect_key)
I guess the problem just webapp (js/controllers/api-documentation.js)
Afer some testing I arrive on file (js/services/api.js) on method "saveDocumentation" and two paramters :
The problem is in url "RPC" while I work on "REST" service, if I replace "RPC" by "REST" its works, the documentation is correctly recorded but only for services "REST" because I just quickly test with : url = url.replace('rpc', 'rest');
I work on debian 7 - Apache 2.2.22 - PHP (mod) 5.4.4 - browser: Chrome and Iceweasel