Skip to content

Commit

Permalink
doc: update readme and example to reflect the latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
irainia committed Nov 17, 2021
1 parent 0ca540a commit 72efb93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ frameworks:
type: file
format: json
path: ./example/schema/user_account_rule.json
output_is_error: true
procedures:
- name: enrich_user_account
type: file
Expand All @@ -53,13 +52,13 @@ In this example, Resource named `user_account` will be evaluated agaist
framework named `user_account_validation`. The targetted framework
specifies three things:

* Schema follows JSON schema format to validate the Resource. It is
* Schema, which follows JSON schema format to validate the Resource. It is
required to validate whether the structure for the `user_account`
Resource contains error or not.
* Procedure follows JSONNET format to evaluate the `user_account` Resource.
* Procedure, which follows JSONNET format to evaluate the `user_account` Resource.
It can be for validation or any execution that can't be handled by
using Schema.
* Output Target specifies on how to write the output of either Schema or
* Output Target, which specifies on how to write the output of either Schema or
Procedure or both.

### 3. Execute Pipeline
Expand All @@ -68,11 +67,11 @@ After the preparation is done, try running valor by executing the following
command:

```zsh
./out/valor
./out/valor execute
```

Or, if you have not build it, try building it by following [#HowToBuild](#how-to-build).
Make sure to have the require dependencies specified under [#Dependency](#dependency).
Make sure to have the required dependencies specified under [#Dependency](#dependency).
The output of the above solution should look like the following:

```zsh
Expand Down
10 changes: 4 additions & 6 deletions example/procedure/enrich_user_account.jsonnet
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
local enrich(data) = {
email: data.email,
membership: data.membership,
is_active: data.is_active,
local evaluate(resource, definition, previous) = {
email: resource.email,
membership: resource.membership,
is_active: resource.is_active,
is_valid: true
};

enrich(user_account)
1 change: 0 additions & 1 deletion valor.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ frameworks:
type: file
format: json
path: ./example/schema/user_account_rule.json
output_is_error: true
procedures:
- name: enrich_user_account
type: file
Expand Down

0 comments on commit 72efb93

Please sign in to comment.