Skip to content
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

Automating process of maintaining REST API Catalogs #72

Open
Mariangela opened this issue Mar 10, 2023 · 1 comment
Open

Automating process of maintaining REST API Catalogs #72

Mariangela opened this issue Mar 10, 2023 · 1 comment
Assignees
Labels
help wanted Extra attention is needed Type/Improvement

Comments

@Mariangela
Copy link
Contributor

Mariangela commented Mar 10, 2023

Description:

Existing method

When adding REST API catalogs we carryout the following steps:

  1. Download the YAML from the product APK repo (e.g., [2])

  2. Save it in en/docs/catalogs directory in the docs-apk repo

  3. Refer to the YAML in the respective MD file. (e.g., en/docs/catalogs/api-reference-developer-portal.md)

      Example:
      ```
      ---
      template: templates/redoc.html
      ---
    
      <redoc spec-url='{{base_path}}/catalogs/devportal-api.yaml'></redoc>
      <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
      ```
    

    The REST API catalog will rendered as expected. (e.g., https://apk.docs.wso2.com/en/latest/catalogs/api-reference-developer-portal/)

Screenshot 2023-03-20 at 11 43 19 AM

Disadvantage of the above method

  • Every time changes are done to the REST API YAML file in the APK product repo (wso2/apk [1]), we have to manually copy the YAML file and and add it to the APK docs repo (wso2/docs-apk [2] repo).
  • There is a high possibility that the content in the APK docs will be outdated because APK devs may not remember alert when changes are done in the REST API YAML docs.

[1] https://github.com/wso2/apk
[2] https://github.com/wso2/docs-apk

Proposed Fix

@sanjeewa-malalgoda suggested to also get the https://github.com/wso2/apk repo to build as well in the APK build script [3]. So that we can automate the process.

Note

When trying to add the APK product repo GitHub URL directly in the APK docs repo MD file the REST API Catalog does not work.

---
template: templates/redoc.html
---

<redoc spec-url='[{{base_path}}/catalogs/devportal-api.yaml](https://github.com/wso2/apk/blob/main/devportal/devportal-domain-service/ballerina/resources/devportal-api.yaml)'></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>

Screenshot 2023-03-10 at 1 36 06 PM

[1] en/docs/catalogs/api-reference-developer-portal.md
[2] https://github.com/wso2/apk/blob/main/devportal/devportal-domain-service/ballerina/resources/devportal-api.yaml
[3] https://wso2.org/jenkins/job/docs/job/docs-apk/configure

@Mariangela Mariangela added help wanted Extra attention is needed Type/Improvement labels Mar 10, 2023
chanaka3d added a commit to chanaka3d/docs-apk that referenced this issue Mar 23, 2023
chanaka3d added a commit that referenced this issue Mar 23, 2023
@chanaka3d
Copy link
Contributor

This issue is fixed in the dev environment. Please check and confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Type/Improvement
Projects
None yet
Development

No branches or pull requests

2 participants