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

Generate adapter documentation automatically #413

Closed
krebernisak opened this issue Apr 2, 2021 · 4 comments · Fixed by #415
Closed

Generate adapter documentation automatically #413

krebernisak opened this issue Apr 2, 2021 · 4 comments · Fixed by #415
Labels
documentation Improvements or additions to documentation enhancement New feature or request low priority This issue is holding on to a concern, but not to be working on immediately

Comments

@krebernisak
Copy link
Contributor

Keeping documentation up to date for adapters is painful, and we should be looking at how to automate this process.

The discussion on the topic started here.

@krebernisak krebernisak added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 2, 2021
@aalu1418
Copy link
Contributor

aalu1418 commented Apr 2, 2021

Adding a few notes from some research on automated API documentation:

There seems to be a lot of tools converting from OAS to other readable formats:

  • https://openapi.tools/#documentation
  • Most generate complete webpages rather than a simple markdown file
  • A custom script could be used to create readme documentation from the OAS format?

On a different note, this could be used for autogenerating code documentation (probably not needed for EAs, but maybe in the bootstrap?)

@aalu1418
Copy link
Contributor

aalu1418 commented Apr 2, 2021

Current configuration/tools:
Using swagger-jsdoc v6.x as a CLI tool to build OpenAPI spec from code comments.

Command to run (from root):

yarn docgen source coingecko

Example in the coingecko source adapter in the feature/autogen-docs branch.

Next tasks:

  • Generate definition.json file automatically for the adapter
  • Create proper documentation structure in jsdoc comments (check for inserting environment variable parameters)
  • Generate complete OAS spec for one repo (not sure it exactly follows OAS, but it is a somewhat standardized format)
  • Remove npx usage? (would speed up process when all files need to autogen docs)
  • Front-end visualization of documentation (converting OAS structure to hosted webpages?)

New things to consider:

  • Dynamically generating OAS by checking functions/variables in the EA?
  • Using jsonnet? (and/or using jsonnet to configure the EA - this requires a lot more revamp of EAs)

UPDATE: See Feautre/autogen-docs PR for the latest

@aalu1418 aalu1418 linked a pull request Apr 5, 2021 that will close this issue
10 tasks
@aalu1418
Copy link
Contributor

New working branch: https://github.com/smartcontractkit/external-adapters-js/tree/feature/autogen-docs-2
Trying to pull parameters directly out of EAs

  • Pull endpoint parameters from ./endpoint/*.ts files
  • Pull possible endpoints from adapter.ts
  • Pull environment variables from config.ts

For full deployment, requires changes to existing EAs to export the necessary parameters

@aalu1418 aalu1418 added the low priority This issue is holding on to a concern, but not to be working on immediately label Apr 12, 2021
@boxhock
Copy link
Contributor

boxhock commented Jan 18, 2022

@austinborn is owning autogenerating documentation on separate stories now

@boxhock boxhock closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request low priority This issue is holding on to a concern, but not to be working on immediately
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants