Converts incoming json, xml or properties to json, xml or properties.
This yq based service can convert incoming json, xml, csv, tsv or properties data into the same formats. The incoming data can be a string, file path or base64-encoded string.
functions:
- id: yaml2json
image: direktiv/yaml2json
type: knative-workflow
- id: convert
type: action
action:
function: yaml2json
input:
data: 'hello: world'
output-format: json
input-type: string
- id: set
type: setter
variables:
- key: indata
scope: instance
mimeType: text/plain
value: 'hello: world'
transition: modify
- id: modify
type: action
action:
function: yaml2json
files:
- key: indata
scope: instance
input:
data: indata
output-format: json
input-type: file
- id: convert
type: action
action:
function: yaml2json
input:
data: aGVsbG86IHdvcmxk
output-format: xml
input-type: base64
The service requires only the data field but can accept different data types.
nice greeting
"Hello YourName"
| Type | Description |
|---|---|
| io.direktiv.command.error | Command execution failed |
| io.direktiv.output.error | Template error for output generation of the service |
| io.direktiv.ri.error | Can not create information object from request |
Properties
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| output | PostOKBodyOutput | PostOKBodyOutput |
Properties
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| result | interface{} | interface{} | ||||
| success | boolean | bool |
Properties
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| data | string | string | ✓ | Depending on the input-type this value can be a file path, base64 string or a plain string. | aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ== | |
| input-format | string | string | "yaml" | Input format. Possible values are yaml,xml,prop. | xml | |
| input-type | string | string | "string" | base64 | ||
| output-format | string | string | "json" | Output format. Possible values are yaml, json, props, csv, tsv, xml. | json |
Content type
Image
Digest
sha256:09657e3a5…
Size
76.7 MB
Last updated
about 4 years ago
docker pull westwind027/yaml2json