Open jdimeo opened 3 years ago
I've temporarily fixed this on our fork: https://github.com/ElderResearch/enunciate-openapi/commit/8a61d008b094f93c3def81a68fd5435cde90a22c
However, I'm not opening a PR because I think this makes the wrong assumptions. Currently, it was expecting every example to be valid JSON. Now, I'm expecting it to never be JSON/an object, but rather a scalar value (like I have in my example above). This makes the most sense for field-level examples, but could break class-level examples.
Why is it using the ObjectTypeRenderer
? do we need to annotate our method somehow to clue it in to the fact that it's a scalar value? perhaps this is a documentation and/or better stack trace issue rather than a bug.
It appears that whenever you use a
@documentationExample
, it gets written to the YAML improperly and causes a parse error. I tried with single quotes and double quotes neither fixed it.For example, this bean:
throws this error: