carlansley / swagger2

Loading, parsing and validating requests to HTTP services based on Swagger v2.0 documents
MIT License
25 stars 17 forks source link

support loading from string? #35

Open qinst64 opened 4 years ago

qinst64 commented 4 years ago

I can find it supports loadDocumentSync, which accepts filepath as input . what about adding support for string in case the doc is aleady in the memory?

e.g. for yamljs it has YAML.parse ans YAML.load for yaml it has YAML.parse only but you can read file first, thus we still can deal with both file & string.

The currently version uses yamljs and only implements YAML.load, I can load from file, but cannot do it the other way.