openapi-diff
Version:
A CLI tool to identify differences between Swagger/OpenAPI specs.
14 lines (13 loc) • 639 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const parse_x_properties_1 = require("./common/parse-x-properties");
const path_builder_1 = require("./common/path-builder");
const parse_openapi3_paths_1 = require("./openapi3/parse-openapi3-paths");
exports.parseOpenApi3Spec = (spec) => {
const pathBuilder = path_builder_1.PathBuilder.createRootPathBuilder();
return {
format: 'openapi3',
paths: parse_openapi3_paths_1.parseOpenApi3Paths(spec.paths, pathBuilder.withChild('paths'), spec),
xProperties: parse_x_properties_1.parseXPropertiesInObject(spec, pathBuilder)
};
};