File tree Expand file tree Collapse file tree
main/groovy/com/github/hauner/openapi/spring/generatr
test/groovy/com/github/hauner/openapi/spring/generatr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,19 +45,19 @@ class MappingConverter {
4545 List<Mapping > convert (YamlMapping source ) {
4646 def result = new ArrayList<Mapping > ()
4747
48- source. map. types. each {
48+ source? . map? . types? . each {
4949 result. add (convertType (it))
5050 }
5151
52- source. map. parameters. each {
52+ source? . map? . parameters? . each {
5353 result. add (convertParameter (it))
5454 }
5555
56- source. map. responses. each {
56+ source? . map? . responses? . each {
5757 result. add (convertResponse (it))
5858 }
5959
60- source. map. paths. each {
60+ source? . map? . paths? . each {
6161 result. add(convertPath (it. key, it. value))
6262 }
6363
Original file line number Diff line number Diff line change @@ -316,4 +316,15 @@ map:
316316 exclude << [true , false ]
317317 }
318318
319+ void " handles empty mapping" () {
320+ String yaml = " "
321+
322+ when :
323+ def mapping = reader. read (yaml)
324+ def mappings = converter. convert (mapping)
325+
326+ then :
327+ mappings. size() == 0
328+ }
329+
319330}
You can’t perform that action at this time.
0 commit comments