kin-openapi
kin-openapi copied to clipboard
Load yaml file for openapi2
Hi guys, thank you so much for this awesome library.
I'm opening this issue just to ask a question: is a way to load an openapi2 specification from a yaml file?
Currently I'm:
- loading it;
- converting it to JSON;
- using the
UnmarshalJSON
method to fill the openapi2.T object.
Is there a better way? Because the convertion yaml 2 json is a little bit heavy for large specifications.
Have a look at https://github.com/ghodss/yaml
And if you have the time I'd happily review a pull request that solves this for others, be it only an example.
See https://github.com/getkin/kin-openapi/blob/0a4abfc91ea65332d247587bda355ab2ed461ef0/openapi2/openapi2_test.go#L45