openapi-diff
Version:
A CLI tool to identify differences between Swagger/OpenAPI specs.
16 lines (15 loc) • 730 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseOpenApi3Spec = void 0;
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");
const parseOpenApi3Spec = (spec) => {
const pathBuilder = path_builder_1.PathBuilder.createRootPathBuilder();
return {
format: 'openapi3',
paths: (0, parse_openapi3_paths_1.parseOpenApi3Paths)(spec.paths, pathBuilder.withChild('paths'), spec),
xProperties: (0, parse_x_properties_1.parseXPropertiesInObject)(spec, pathBuilder)
};
};
exports.parseOpenApi3Spec = parseOpenApi3Spec;