According to OpenAPI 3.0 Specification,
the field "examples" should be a map.
Example:
examples:
foo:
summary: A foo example
value: {"foo": "bar"}
bar:
summary: A bar example
value: {"bar": "baz"}
However, in the current implementation of this plugin, it is implemented as an array.
Ref:
In serverless-openapi/src/DefinitionGenerator.ts
if (parameter.example) {
parameterConfig.example = parameter.example;
// BELOW (Line 227)
} else if (parameter.examples && Array.isArray(parameter.examples)) {
// ABOVE (Line 227)
parameterConfig.examples = parameter.examples;
}
private attachExamples(target, config) {
// BELOW (Line 307)
if (target.examples && Array.isArray(target.examples)) {
// ABOVE (Line 307)
_.merge(config, { examples: _.cloneDeep(target.examples) });
} else if (target.example) {
_.merge(config, { example: _.cloneDeep(target.example) });
}
}
According to OpenAPI 3.0 Specification,
the field "examples" should be a map.
Example:
However, in the current implementation of this plugin, it is implemented as an array.
Ref:
In
serverless-openapi/src/DefinitionGenerator.ts