specification
specification copied to clipboard
Enforce naming conventions
What would you like to be added:
Enforce naming conventions of most (if not all) components.
I propose that we enforce using snake and/or kebab cased names.
Why is this needed:
In the case of functionDefs
of type expression
, for example, not enforcing a naming convention makes expression parsing a huge mess.
Consider the following example:
functions:
- name: Say Hello
type: expression
operation: 'Hello!'
Now to call the function in an expression as defined by the spec, you'd need to write something like:
. | . * { "greetings": "fn:Say Hello" }
... which is impossible to parse both properly and/or safely. We could of course mandate to put the function's name between parenthesis (ex: $fn:(Say Hello)
), for example, but I think the easier and cleanier approach is to go with a naming convention
Agree, will do pr for it
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Let's use Kubernetes convention for naming: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
They are based on RFC1123, so it's safe for DNS too.
Let's use Kubernetes convention for naming: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
They are based on RFC1123, so it's safe for DNS too.
Hmmm, I think we should support _ for naming, without the need of escaping it
I think we should allow _ in the id, there is always the possibility of mapping it to - when being used as k8s label. Besides that I think ids can include more special characters than functions (-,_,&,!) For functions, as a developer, I would ban most of special characters: &, |, @, &, ?, $, (, ), {,}, [,], +, -, because they might appear in a jq expression, so to make things simpler I vote for snake (which uses _, not -, which might be interpreted as minus operation) and allowing the same chars that JQ does (letter, numbers and of course _)