-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proof-of-concept API derived from OpenAPI docs #100
base: master
Are you sure you want to change the base?
Conversation
The formatting code may be simplified if we can use f-strings. |
Feedback and contributions to this PR are welcome. There are currently many API endpoints that aren't implemented in the latest version of this driver so this, or a similar solution, is much needed. |
@unode Thanks for this, that is great. I will try to have a look at this as soon as I can, because having this feature would help a lot! |
I was looking at this also we should definitely be able to figure out the arguments from the api definition. |
Hi @fried, just to let you and everyone here know that I have some progress from my last PoC. I think I managed to get all the details out and some edge cases as well, missing only some implementation bits. |
Hi everyone! Finally had a chance to complete this. The generated code produces function names also derived from the OpenAPI docs. For the time being I'm considering the current Feedback is very much welcome! |
Things that need polishing include docstrings that are also currently autogenerated. |
Now at python-mattermost-autodriver under a new name |
Hi @unode, I feel like I really have to react already, sorry for the long delay. I have too much going on which results in this project not getting the attention it needs. Since you already felt the need to make a fork, I was wondering if your fork is the better way forward then? I already realized that I should probably look for a maintainer or something like that, since I just don't get around to properly deal with issues here, but I also don't have a clue how one would do that. Also, I really, really appreciate the work you put into this! |
Hi @Vaelor, No worries. We all know how getting busy can leave little to no time for side-projects. Same is true over here. At the moment I created the fork mostly to allow easier testing and feedback if anyone in this thread wants to give it a try. Regarding finding a maintainer, I'd say start with a disclaimer in the README. Alternatively it may be worth considering moving the repository to a separate organization to simplify adding new maintainers. It may also be that the mattermost python community may be interested in picking up from where we left. That said, with the OpenAPI parsing script I wrote, maintenance will likely be centered on the script itself. Besides that one only needs to ensure that the autogenerated code is correct and not utterly broken. There's the option of writing unit tests but I'm not sure how to go about that either. |
I'm leaving this open for the present time but would like to let everyone know that I started moving ahead with https://github.com/embl-bio-it/python-mattermost-autodriver which is now also available through PyPi at https://pypi.org/project/mattermostautodriver/ . Notably, the auto-generated code doesn't currently provide a backwards compatibility layer. Old code using Calling the new repository a fork is a bit of a stretch given that all the code in the endpoints folder is now auto-generated. I already invited @Vaelor to co-maintain the auto-generated project. If any of the past contributors would like to help maintaining the new project, please reply in this thread and an invitation will follow. |
This is an incomplete attempt at implementing #60
Currently missing:
For the remaining first point, it may be possible to extract info from
requestBody > content > multipart/form-data
.At the moment, what was:
became
How to use
Generate OpenAPI json file
This creates
mattermost-api-reference/openapi.json
.Generate API driver code