go-openapi / spec

openapi specification object model
Apache License 2.0
394 stars 100 forks source link

SafeExpand with callback to retrieve all errors #53

Closed fredbi closed 6 years ago

fredbi commented 6 years ago

Similarly to the "safe" version of methods I added to analysis with go-openapi/analysis#23, I propose a similar SafeExpanded() which would really implement the "ContinueOnErrors" option by calling a callback function and return only an expanded spec (possibly empty).

This would allow go-openapi/validate to fullfil its validation when its own ContinueOnErrors option is set.

Benefit: validate would report the full list of unresolved references instead of just the first found

Any recommandation/thought on that?

fredbi commented 6 years ago

Will do this in analysis - no need to change spec.