openapi-diff
Version:
A CLI tool to identify differences between Swagger/OpenAPI specs.
20 lines (19 loc) • 796 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseSwagger2BodyObjectJsonSchema = void 0;
const to_diff_ready_swagger2_schema_1 = require("./to-diff-ready-swagger2-schema");
const toParsedJsonSchema = (schema, pathBuilder, spec) => {
return {
originalValue: {
originalPath: pathBuilder.withChild('schema').build(),
value: schema
},
schema: (0, to_diff_ready_swagger2_schema_1.toDiffReadySwagger2Schema)(schema, spec)
};
};
const parseSwagger2BodyObjectJsonSchema = (bodyObject, pathBuilder, spec) => {
return bodyObject.schema
? toParsedJsonSchema(bodyObject.schema, pathBuilder, spec)
: undefined;
};
exports.parseSwagger2BodyObjectJsonSchema = parseSwagger2BodyObjectJsonSchema;