NeuraLegion/har-sdk

OAS: Body parameter default value could not be retrieved

Closed this issue · 0 comments

The method OasV2ParameterObjectsParser.parseBodyParameter is not able to retrieve the default parameter value when it is specified in /definitions/some-object-definition/schema/default node, as it uses an original instance of the specification document.

const operationObject: OpenAPIV2.OperationObject = jsonPointer.get(
this.doc,
jsonPointer.compile(jsonPointer.parse(pointer).slice(0, -2))
);
const mimeTypes = operationObject.consumes || ['application/json'];
const value = parameter.schema?.default;

The method should take the value from the dereferenced document instance.