Skip to content

Conversation

@mtuchi
Copy link
Contributor

@mtuchi mtuchi commented Oct 29, 2025

Description

This PR does 2 things,

  • Generate a postman collection in priv/static/postman.json
  • Generate API docs from @moduledoc, @doc comments in API controllers in priv/static/docs.json [Just few of them for proof of concept]

Validation steps

  1. git checkout api-docs
  2. mix deps.get
  3. To test generating postman collection, run DOC=1 mix test. Once it's done, see priv/static/postman.json
  4. To test generating API docs mix compile.docout. Once it's done, see priv/static/docs.json

Additional notes for the reviewer

The original issue request was to port lighting API docs to docs.openfn.org and See OpenFn/docs#715. Although this PR does not generate a Open API spec that can be used in docs.openfn.org, This change is 1 step closer towards that direction.

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@github-project-automation github-project-automation bot moved this to New Issues in v2 Oct 29, 2025
@mtuchi
Copy link
Contributor Author

mtuchi commented Dec 5, 2025

This is how the API Documentation looks when imported in Postman

Screenshot 2025-12-05 at 14 01 33

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is partly AI generated (80% ish). I am not sure what most of these codes mean but it does the job.
This is how i extract @moduledoc and @doc comments from API Controllers like workflows_controller.ex

The goal is to link these docs as description in postman collection requests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 100% AI generated, I am not sure how useful they are. I had to ask help from AI because my formatter kept breaking when i was running mix compile.docout, Mostly the bug was related to data types and empty functions.

The issue occurred because docout is marked as runtime: false in the dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

2 participants