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

common.each is duplicated in the docs listing #447

Open
josephjclark opened this issue Mar 22, 2024 · 2 comments
Open

common.each is duplicated in the docs listing #447

josephjclark opened this issue Mar 22, 2024 · 2 comments

Comments

@josephjclark
Copy link
Contributor

image

@mtuchi
Copy link
Contributor

mtuchi commented May 8, 2024

After investigating i found that in common adaptor we have two each function one is in common/Adaptors.js the other one is in common/beta.js. When you build docs for common it will create two documentation for each function.

You can test this in common adaptors by changing the common example to

*  @example
*  beta.each("$.[*]",
*    create("SObject",
*    field("FirstName", sourceValue("$.firstName")))
*  )

Then build the docs by running pnpm build which will create docs/index.md

@josephjclark
Copy link
Contributor Author

Thank you @mtuchi

The correct answer here is to namespace the docs properly. Rather than printing a flat list of all operations, we list Main Operations, Utils (util.expandReferences), Beta (beta.each), HTTP (http.get) etc.

We need to work this out at some stage, because the flat list of exports doesn't really marry with the modern design of adaptors (consider the new common http utils). I am not sure that the namespace design in the adaptors themselves is entirely thought through or consistent.

I've raised an issue in adaptors for common specifically: OpenFn/adaptors#550 A short-term solution may be to simply ignore the beta namespace in the docs

But docs do need to handle the wider case of namespacing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants