Search code examples
apiblueprint

How to generate json/yaml with redsnow


https://github.com/apiaryio/redsnow
https://github.com/apiaryio/matter_compiler

I need to generate a json/yaml with redsnow for matter_compiler.
I checked the docs & code, but didn't find it. Is it possible for now?

Why I need it:
I want to generate apiblueprint-markdown with data from tests/specs.


Solution

  • Yes, RedSnow doesn't support serialization to JSON/YAML. Serialize is only in SnowCrash.

    But you can look into blueprint.rb in matter_compiler. You can extend this class and use his serialize methods to create markdown from your classes.