Skip to content

Commit

Permalink
fix: add support for avro and openapi formats (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Jan 19, 2022
1 parent 3335065 commit 419d806
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 7 deletions.
43 changes: 37 additions & 6 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"./LICENSE"
],
"dependencies": {
"@asyncapi/avro-schema-parser": "^1.0.1",
"@asyncapi/converter": "^0.6.1",
"@asyncapi/openapi-schema-parser": "^2.0.1",
"@asyncapi/parser": "^1.12.0",
"@asyncapi/react-component": "^1.0.0-next.31",
"@asyncapi/specs": "^2.12.0",
Expand Down
9 changes: 8 additions & 1 deletion src/services/specification.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// @ts-ignore
import { convert } from '@asyncapi/converter';
import { parse, AsyncAPIDocument } from '@asyncapi/parser';
import { parse, registerSchemaParser, AsyncAPIDocument } from '@asyncapi/parser';
// @ts-ignore
import openapiSchemaParser from '@asyncapi/openapi-schema-parser';
// @ts-ignore
import avroSchemaParser from '@asyncapi/avro-schema-parser';
// @ts-ignore
import specs from '@asyncapi/specs';

Expand All @@ -10,6 +14,9 @@ import { MonacoService } from './monaco.service';

import state from '../state';

registerSchemaParser(openapiSchemaParser);
registerSchemaParser(avroSchemaParser);

export class SpecificationService {
static getParsedSpec() {
return window.ParsedSpec || null;
Expand Down

0 comments on commit 419d806

Please sign in to comment.