forked from conqa/serverless-openapi-documentation
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
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) });
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels