The default value of an enum changes depending on whether it is defined in the main input file or in a referenced file.
Although I'm new to swagger-parser, this seems like a bug to me. Using the flatten and resolveFully options doesn't make a difference.
The default value of an enum changes depending on whether it is defined in the main input file or in a referenced file. Although I'm new to swagger-parser, this seems like a bug to me. Using the
flatten
andresolveFully
options doesn't make a difference.Example 1
input1.yaml
:input1Child.yaml
:Here the pets default value is parsed to be
[DOG, FISH]
.Example 2
input2.yaml
:Here the pets default value is parsed to be
["DOG","FISH"]
.I used the latest swagger-parser version, 2.1.16, for these examples. And I created a minimal executable example at https://github.com/martin-mfg/swagger-parser-demo that demos the issue.