Open jp1987 opened 1 year ago
I am willing to work in the issue and submit a patch but I would first like to know if this is something the maintainers of Asterisk would merge?
That depends on how it is done. If we maintain backwards compatibility for the existing way then most likely yes.However before actually starting work how it is used today has to be explored and understood, and then ideally a proposal written of how it would work going forward so it can be discussed before work begins.
Well I can think of mainly two uses:
Technically since there is no code involved and its just a JSON file, I really can't think of something we could consider breaking, at least in the level of changing the API of some code or diaplan function. However these are two disruptions I can think of:
Worst case scenario we can leave everything and simply add a new v2 file. ARI does not have constant changes so keeping them up to date probably won't be an issue, however if possible I am a bigger fan of deleting the old and leaving the new.
I missed the part of how it would work after the changes, ideally it will work exactly the same, just with a newer spec. I will have to see if that is actually the case.
The JSON definitions are also used to produce templated C code in Asterisk for the ARI server side implementation. Which means the old one can't just be removed, because that would break the ability to modify ARI in Asterisk itself.
Oh dangit, TIL haha. I will test and also take that into consideration as well.
I will attach the converted swagger.json file. I used swagger-codegen for the conversion.
File: swagger.json
Sadly it seems more destructive than I thought:
So it seems like Sangoma would need to update the Swagger UI version on they host. The script used for ari-stubs could be updated or we can probably find some third-party tool that does all the conversion. I could not find references in code to resources.json to generate C code.
Finally, here is a screenshot of what could be, looks pretty, although the auto-generated file still needs to have its tags fixed.
ARI is still using Swagger v1.1, which is deprecated.