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

Self contained action schemas #368

Open
masaeedu opened this issue May 12, 2020 · 0 comments
Open

Self contained action schemas #368

masaeedu opened this issue May 12, 2020 · 0 comments

Comments

@masaeedu
Copy link

masaeedu commented May 12, 2020

It seems like the spec could be made a little bit stupider (in a good way) if the applyTo, definitions, etc. business was replaced with a dictionary of the form:

"actions": {
  "<action name>": {
    "parameters": <json schema>,
    "outputs":  <json schema>
  },
  "<action name>": {
    "parameters": <json schema>,
    "outputs":  <json schema>
  },
  ...
}

Then the parameters can just be presented to the invocation image as a file containing a big opaque schema conformant blob of JSON, and in turn the invocation image can write out a big opaque schema conformant blog of JSON as the output (corresponding to whatever action it ran). If I want to load stuff from the parameters into environment variables or move it around into some weird folder structure where each parameter shows up in a file, I can just have some tools baked into my invocation image that help me do that.

My understanding of the intention behind applyTo, definitions, etc. is that it makes the schema definition DRY, and thus less tedious/error prone to write. However I think it's safe to assume that in many (most?) cases, bundle.json will be machine generated from some other higher-level/more human friendly format. E.g. there's jsonnet and YAML and Dhall and many other such things that can be compiled to a single JSON file, and which deal with imports and reusable variables and so on. Couldn't DRYing out the schema definitions be deferred to those tools?

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

1 participant