Skip to content

Sjsonnet does not reject invalid arguments being passed to a function #5

@lihaoyi-databricks

Description

@lihaoyi-databricks

The following snippet fails with google/jsonnet, passes with sjsonnet:

lihaoyi ~$ cat foo.jsonnet
// A function that returns an object.
local Person(name='Alice') = {
  name: name,
  welcome: 'Hello ' + name + '!',
};
{
  person2: Person('Bob', hello=123),
}
lihaoyi ~$ ./sjsonnet.jar foo.jsonnet
{
   "person2": {
      "name": "Bob",
      "welcome": "Hello Bob!"
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions