thanks @burke @ayesh @saurabh @ssmusoke for all the inputs on this!
@saurabh has shared the survey here.It will be really helpful for us to idnetify the missing parts if you have a look on it
Thank you
@ayesh @burke @ssmusoke if the form looks good should I open the form for the communityâs feedback, I will create a seperate post for it and link the post here .
When I went for a last minute review of the form, I was greeted by a message saying âThe form OpenMRS Rest API documentation Survey is no longer accepting responses. Try contacting the owner of the form if you think this is a mistake.â
@burke but I havent yet made the form open for accepting responses I thought I will do that after making it public on the talk
I made it open for accepting responses now !!
@saurabh, overall it looks good.
Iâd consider making the first question optional. People may have useful feedback for you but not want to take the time to fill out a priority grid.
For me, the first question is hard to answer, because what I consider to be high priorities arenât in the list. From my perspective, the approach would be something like:
- Documentation developers can count on for the basics & most commonly used parts of the API (e.g., authentication, patient, encounter/visit, obs) with helpful, concise documentation, good descriptions, and examples that work.
- Clean up issues with existing documentation (typos, broken links, âparrotingâ descriptions like fooâs bar property described as âBar of the fooâ, etc.), especially for resources in #1.
- Using output from #1 & #2 as our ânorth starâ (exemplars of ideal documentation) to inform changes needed in source code so that we can auto-generate useful documentation for those resources.
- Updating source code annotations based on findings in #3, so we have decent auto-generated documentation.
- Creating/fixing a Maven task to generate Swagger documentation that can be woven together with static documentation to generate the content that we can host at rest.openmrs.org and could be built into the REST module to be served up in place of the current Swagger documentation.
- JS examples.
- Expand to more resources.
- Interactive examples.
In any case, donât let perfect be the enemy of good⊠announce your survey in the dev category of Talk as soon as you have @ayeshâs approval.
@burke thanks alot for the valuable feedback. I would agree on the priority of the list and it make sense to move forward on that way.
@saurabh I would suggest you to do the changes burke mentioned. Letâs publish it as soon as the changes are done.
Also great work on bringing up the survey so fast. Nice work @saurabh
@burke @ayesh I am bit unclear about #3, #4
I get #2, we would dive deep into those basic resources and try to get as close to the ideal documentation as possible .
Then I am a bit unsure what do we do in #3 and #4, try and get those changes incorporated in the swagger auto generated documentation by editing the OpenAPI spec or any anything else I dint get ? or try and expand the work done to other resources.
Then in #5 we embed the auto-generated documentation (after going through #3 and #4) in our static documentation which would even give us a try-out-feature in our static documentation.
I think the current Swagger documentation may be built through real-time queries to the API. While this sounds like the coolest & most robust approach to ensuring resources are properly represented, the reality leaves a lot to be desired. First, thereâs an undesirable delay to regenerate the documentation every time itâs referenced, making the real-time generation less than ideal. Secondly, the auto-generated properties are often not what weâd want (e.g., all the details for a location instead of just the UUID as reference). Lastly, the datatypes are under-specified and description are lacking in many/most cases.
That said, I was hoping/expecting that we could use a Swagger/OpenAPI tool to generate an OpenAPI document from comments/annotations in the code. If true, then the task ahead would be to go through those annotations/comments and populate them so we can generate documentation similar to #2.
I will do a bit of research about it and see how would it work but currently I will add these to the google form
@saurabh yes when moving forward letâs try to find a way and do it together. For now, letâs get feedback from the community.
the survey is up
nice
cc :- @jennifer @grace @herbert24 we need some help here to get responses to the survey.
Good job, @saurabh. I made a few tweaks to your post. I hope thatâs okay.
just a thought since we find it difficult to make examples that actually work at an instance since sometimes the UUID used in the examples arent present on the server.
-
we can shift the create Resource section above the list resource section in every resource heading and that way we would be able to use the UUID of the created resource for listing, editing and deleting .
-
sometimes in complex resources there is a requirement of other resourcesâ UUID as well, in this case we might need to make some resources read-only on the server so that they cant be deleted and can be used in the examples safely.
(I have seen instances of such resources while creating examples for system setting
here and I had mentioned there that we must create our own system setting in order to modify it because some of them are read-only)
I would suggest using UUIDs for data provided in the default demo dataset. The demo dataset SQL is here. The easiest way to play with the demo data at the moment is to use Docker:
- Copy this docker-compose.yml file into a local folder,
- Place this SQL file into a
dbdump
subfolder - Type
docker-compose up -d
in the original folder (containing thedocker-compose.yml
file)
Within a few minutes, you should have OpenMRS with demo data starting up locally at http://localhost:8080/openmrs/ and, when itâs done, you can login using admin
/Admin123
credentials. You can also test the API using httpie:
$ http localhost:8080/openmrs/ws/rest/v1/session
HTTP/1.1 200 OK
Content-Length: 70
Content-Type: application/json;charset=UTF-8
Date: Fri, 28 Aug 2020 15:49:38 GMT
ETag: "0c4da90337cfeb79674b823f8e4c42e47"
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=A5CD4820FD7BBD22ECC1DFC58758E49C; Path=/openmrs; HttpOnly
{
"authenticated": false,
"sessionId": "A5CD4820FD7BBD22ECC1DFC58758E49C"
}
p.s. You can stop and start OpenMRS with docker-compose stop
and docker-compose start
(takes a few minutes to restart). You can clean up (remove everything) with docker-compose down -v
(youâll have to go through full initialization process the next time you bring it up).
@burke I will try setting this up thanks .
if developers try these examples on the demo -server will these examples still work? since I think people can purge some of the resources present on the server.
tl;dr true, but I wouldnât worry about it
Correct, but I donât think this is a big enough problem to worry about. If we end up with issues of people routinely purging data on the demo server, we can either try pointing our examples to different resources (e.g., if we happened to pick resources that are more commonly purged on demo) or consider making some data read only on demo. I donât think this is going to be enough of an issue to warrant the effort.
A more likely issue is demo being down, but I think that will be less of a problem over time as we improve our dockerization and by adapting demo to use an image that has already performed initialization.