cesarParra / apexdocs

Node.js tool to generate documentation for your Salesforce Apex Classes.
https://www.npmjs.com/package/@cparra/apexdocs
MIT License
109 stars 18 forks source link

Open API documentation generation - support for recursive directories #179

Closed RaviVaranasi closed 1 week ago

RaviVaranasi commented 1 week ago

Thanks for creating this to improve the documentation of the salesforce apex code. I tried to upgrade to 3.0 version of apex-docs. The earlier version used to look for recursive references within force-app/main/default (we have sub-folders under classes)

Screenshot 2024-09-19 at 9 18 11 AM

Command i run: apexdocs openapi -s force-app/main/default/classes --title 'Custom API documentation' -g openapi --openApiFileName api-file

It does detect the documentation files

Screenshot 2024-09-19 at 9 22 13 AM

apexdocs openapi -s force-app/main/default/classes/rest --title 'Custom API documentation' -g openapi --openApiFileName api-file

It throws a reference error

Screenshot 2024-09-19 at 9 23 07 AM
cesarParra commented 1 week ago

Thanks @RaviVaranasi

Let me investigate

cesarParra commented 1 week ago

@RaviVaranasi

I believe I have identified the issue and I've released version 3.1.1 with it. Please let me know if that resolves it, otherwise feel free to reopen this.

By the way, in v3 there are a few changes to the flags, so the command you are trying to use needs a couple of minor adjustments.

First is that the -g flag is no longer necessary, since that is now being handled by calling the apexdocs openapi subcommand, which already will know to generate the OpenApi spec and not markdown.

The other thing is that now that openapi has its own subcommand, the openApiFileName has been renamed to just be fileName, since now the flags are specific to each subcommand and not shared, so I was able to clean that up a bit. So now your command should look something more like

apexdocs openapi -s force-app/main/default/classes --title 'Custom API documentation' --fileName api-file
RaviVaranasi commented 1 week ago

That was fast but will confirm if that fixed it

RaviVaranasi commented 1 week ago

That fixed the issue 🚀 🎉 . Appreciate the quick turnaround