Sign inSign up

westwind027/yaml2json

By westwind027

•Updated about 4 years ago

Image
0

359

westwind027/yaml2json repository overview

⁠yaml2json 1.0.0

Converts incoming json, xml or properties to json, xml or properties.



⁠About yaml2json

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.

⁠Example(s)
⁠Function Configuration
functions:
- id: yaml2json
  image: direktiv/yaml2json
  type: knative-workflow
⁠String
- id: convert
  type: action
  action:
    function: yaml2json
    input:
      data: 'hello: world'
      output-format: json
      input-type: string
⁠File
- 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
⁠Base64
- id: convert
  type: action
  action:
    function: yaml2json
    input:
      data: aGVsbG86IHdvcmxk
      output-format: xml
      input-type: base64
⁠Request

The service requires only the data field but can accept different data types.

⁠Request Attributes

PostParamsBody⁠

⁠Response

nice greeting

⁠Reponse Types

PostOKBody⁠

⁠Example Reponses
"Hello YourName"
⁠Errors
TypeDescription
io.direktiv.command.errorCommand execution failed
io.direktiv.output.errorTemplate error for output generation of the service
io.direktiv.ri.errorCan not create information object from request
⁠Types
⁠ postOKBody

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
outputPostOKBodyOutput⁠PostOKBodyOutput
⁠ postOKBodyOutput

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
resultinterface{}⁠interface{}
successbooleanbool
⁠ postParamsBody

Properties

NameTypeGo typeRequiredDefaultDescriptionExample
datastringstring✓Depending on the input-type this value can be a file path, base64 string or a plain string.aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==
input-formatstringstring"yaml"Input format. Possible values are yaml,xml,prop.xml
input-typestringstring"string"base64
output-formatstringstring"json"Output format. Possible values are yaml, json, props, csv, tsv, xml.json

Tag summary

Content type

Image

Digest

sha256:09657e3a5…

Size

76.7 MB

Last updated

about 4 years ago

docker pull westwind027/yaml2json