Hi,
in our ACS-based projects we usually develop many custom REST APIs using the default extension points provided by Alfresco:
I would like to know if there is a way to document our custom APIs using Swagger and OAS (OpenAPI Specification) without handwriting the related YAML/JSON documentation files.
Swagger provide a rich framework to automatically produce API documentation by adding specific Java annotations to controllers but I don't find a way to use this framework with Alfresco WebScript.
Furthermore, we would like to easily use the "API first" approach (API First approach with Swagger) in our ACS-based projects so it would be also really important for us to find a way to produce REST APIs from the Swagger documentation files.
How does Alfresco handle API documentation in Alfresco REST API Explorer (GitHub - Alfresco/rest-api-explorer: Public REST API Explorer)?
In GitHub I found the YAML definition files (https://github.com/Alfresco/rest-api-explorer/tree/master/src/main/webapp/definitions) but I have no idea how Alfresco produces/maintains these files and if these files are also used to automatically produce WebScript definition components (at least the java controllers).
Thank you in advance!
About the 'API first approach':
There already is some tooling around to generate source code from OpenAPI / Swagger documentation, e.g. swagger-api/swagger-codegen or OpenAPITools/openapi-generator.
From my experience with these tools, I think it might be possible to use it in the context of Alfresco if the generators are provided with the correct templates.
I wonder if someone already tried creating such templates for auto-generating Alfresco WebScripts? Might be a good Hack-a-thon project :-)?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.