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

Put all function's name to a dedicated files for easy reference? #259

Open
He-Pin opened this issue Jan 4, 2025 · 2 comments
Open

Put all function's name to a dedicated files for easy reference? #259

He-Pin opened this issue Jan 4, 2025 · 2 comments

Comments

@He-Pin
Copy link
Contributor

He-Pin commented Jan 4, 2025

Motivation:
Currently, all std functions and it's implementation are puted in the Std class, not easy to find out with CRTL + F, how about:

eg:

object StdFunctions {
  val `std.assertEqual(a, b)` = ???
}

for easier search, https://jsonnet.org/ref/stdlib.html

Assertions and Debugging
std.assertEqual(a, b)
Available since version 0.10.0.

Ensure that a == b. Returns true or throws an error message.
@JoshRosen
Copy link
Contributor

JoshRosen commented Jan 6, 2025

I think the motivation for this would be end-user focused, not necessarily sjsonnet-developer-focused: most end users aren't going to want to look at Scala source code to understand the available functions.

I think we can probably just point users to https://jsonnet.org/ref/stdlib.html and say that (as of sjsonnet >= x) we support all standard jsonnet functions. We do have some non-standard additions in the native namespace and those might benefit from documentation in the README, as might any other experimental or new stuff that we add (like regex functions).

@He-Pin
Copy link
Contributor Author

He-Pin commented Jan 7, 2025

@JoshRosen Yes thanks, or it is better to have a list somewhere to check which stdlib methods are already supported.

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

No branches or pull requests

2 participants