Skip to content

Commit

Permalink
feat: implement plugginable architecture
Browse files Browse the repository at this point in the history
Refs #20
  • Loading branch information
char0n committed May 22, 2020
1 parent a658668 commit 499e3bd
Show file tree
Hide file tree
Showing 35 changed files with 982 additions and 471 deletions.
120 changes: 120 additions & 0 deletions apidom/packages/apidom-parser-adapter-openapi3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apidom/packages/apidom-parser-adapter-openapi3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"apidom-ns-openapi3": "^0.1.0",
"json-ast": "^2.1.7",
"ramda": "^0.27.0",
"ramda-adjunct": "^2.26.0"
"ramda-adjunct": "^2.26.0",
"stampit": "^4.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
const apiDOM = require('apidom');
const openapi3 = require('apidom-ns-openapi3');
const jsonAst = require('json-ast');
const DocumentVisitor = require('./visitors/document');
const { specification } = require('./specification');
const { visit } = require('./visitor');

const parse = (source, { sourceMap = false } = {}) => {
const parse = (source, { sourceMap = false, specObj = specification } = {}) => {
const namespace = apiDOM.createNamespace(openapi3);
const ast = jsonAst.parse(source, { verbose: true, junker: true });
const documentVisitor = DocumentVisitor();
const documentVisitor = specObj.visitors.document.$visitor();

visit(ast, documentVisitor, { state: { namespace, sourceMap }});
visit(ast, documentVisitor, { state: { namespace, specObj, sourceMap }});

return documentVisitor.element;
};
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 499e3bd

Please sign in to comment.