Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

safeDump returns AST data as yaml #1

Open
amccloud opened this issue May 4, 2016 · 4 comments
Open

safeDump returns AST data as yaml #1

amccloud opened this issue May 4, 2016 · 4 comments

Comments

@amccloud
Copy link

amccloud commented May 4, 2016

Since safeLoad loads yaml to an AST I would expect safeDump to be the inverse.

YAML

hello: World

AST

{ errors: [],
  startPosition: 0,
  endPosition: 12,
  mappings:
   [ { key: [Object],
       value: [Object],
       startPosition: 0,
       endPosition: 12,
       kind: 1,
       parent: [Circular],
       errors: [] } ],
  kind: 2,
  parent: null }

Expected safeDump

hello: World

Actual safeDump

&ref_1
errors: []
startPosition: 0
endPosition: 12
mappings:
  - &ref_0key:
      errors: []
      startPosition: 0
      endPosition: 5
      value: hello
      kind: 0
      parent: *ref_0
      doubleQuoted: false
      plainScalar: true
    value:
      errors: []
      startPosition: 7
      endPosition: 12
      value: World
      kind: 0
      parent: *ref_0
      doubleQuoted: false
      plainScalar: true
    startPosition: 0
    endPosition: 12
    kind: 1
    parent: *ref_1
    errors: []
kind: 2
parent: null
@petrochenko-pavel-a
Copy link
Contributor

Hi @amccloud thanks for bringing this in at this moment AST dumping functionality is still located at https://github.com/raml-org/raml-js-parser-2. I will move it to this repo as soon as will have a moment to do more cleanup.

Regards,
Pavel

@jstoiko
Copy link

jstoiko commented Dec 11, 2017

any update on this @petrochenko-pavel-a? we want to use safeDump() in another project.

@kand617
Copy link

kand617 commented Sep 24, 2018

@pedrotokarski any update on this? We really could use a way to go back to the markdown from AST...

@nishatsayyed
Copy link

Any update on this, please? The API looks incomplete if this functionality is missing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants