Skip to content

feat!: rewrite to TS and adjust to the v2 ParserJS - #142

Merged
asyncapi-bot merged 14 commits into
asyncapi:masterfrom
magicmatatjahu:rewrite-to-ts
Apr 28, 2023
Merged

asyncapi-bot merged 14 commits into
asyncapi:masterfrom
magicmatatjahu:rewrite-to-ts

Conversation

@magicmatatjahu

Copy link
Copy Markdown
Member

Description

  • Rewrite to TS.
  • Adjust exported module to the new v2 ParserJS Custom Schema Parser interface - new validate() function.
  • Improve testing and move to the Jest.
  • Update Readme.
  • Add @magicmatatjahu to the codeowners.

Related issue(s)
Resolves #140

Comment thread src/index.ts Outdated
return result;
}

async function parse(input: ParseSchemaInput<unknown, unknown>): Promise<v2.SchemaObject> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async function parse(input: ParseSchemaInput<unknown, unknown>): Promise<v2.SchemaObject> {
async function parse(input: ParseSchemaInput<unknown, unknown>): Promise<AsyncAPISchema> {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it perfectly well 😂 I wait for your PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self service! asyncapi/parser-js#656 :D

Comment thread src/index.ts Outdated
// eslint-disable-next-line @typescript-eslint/no-var-requires
const toJsonSchema = require('@openapi-contrib/openapi-schema-to-json-schema');

import type { SchemaParser, ValidateSchemaInput, ParseSchemaInput, SchemaValidateResult } from '@asyncapi/parser';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import type { SchemaParser, ValidateSchemaInput, ParseSchemaInput, SchemaValidateResult } from '@asyncapi/parser';
import type { SchemaParser, ValidateSchemaInput, ParseSchemaInput, SchemaValidateResult, AsyncAPISchema } from '@asyncapi/parser';

Comment thread src/index.ts Outdated
const toJsonSchema = require('@openapi-contrib/openapi-schema-to-json-schema');

import type { SchemaParser, ValidateSchemaInput, ParseSchemaInput, SchemaValidateResult } from '@asyncapi/parser';
import type { v2 } from '@asyncapi/parser/esm/spec-types';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import type { v2 } from '@asyncapi/parser/esm/spec-types';

@smoya

smoya commented Oct 20, 2022

Copy link
Copy Markdown
Member

@magicmatatjahu I think using next-major as target branch its a better approach, so this can be merged and released as beta first.

@magicmatatjahu

Copy link
Copy Markdown
Member Author

@smoya Yeah, we can, but we need branches.

@derberg @fmvilas Could you create next-major branch? I need it for releasing new major version of parser with v2 ParserJS support.

@smoya

smoya commented Nov 8, 2022

Copy link
Copy Markdown
Member

@fmvilas @derberg as code owners, would you mind doing a review to this? Thanks!

@fmvilas fmvilas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general. Just added a comment.

Comment thread CODEOWNERS Resolved
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

fmvilas
fmvilas previously approved these changes Nov 14, 2022
@derberg

derberg commented Nov 14, 2022

Copy link
Copy Markdown
Member

I have same question as asyncapi/avro-schema-parser#168 (review), but this PR is a bit different and points to master directly. Should we really release it as major and automatically bump it in generator?

@magicmatatjahu

magicmatatjahu commented Nov 14, 2022 •

Copy link
Copy Markdown
Member Author

@derberg

Should we really release it as major and automatically bump it in generator?

We will but it doesn't work with parser in generator. In this PR I made integration asyncapi/generator#833 but I'm fighting with snapshots 😆

but this PR is a bit different and points to master directly.

Yeah, because I don't have next-major branch in this repo, cc @fmvilas

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions Bot added the stale label Mar 15, 2023
@smoya

smoya commented Mar 15, 2023

Copy link
Copy Markdown
Member

relevant

@smoya

smoya commented Mar 15, 2023

Copy link
Copy Markdown
Member

@fmvilas @derberg can any of you create the next-major branch? I want to move forward with this PR. Once is done, @magicmatatjahu would u mind changing the base branch and update it?

Thanks

@github-actions github-actions Bot removed the stale label Mar 16, 2023
Comment thread package.json Outdated
"dependencies": {
"@openapi-contrib/openapi-schema-to-json-schema": "^3.0.0"
"@asyncapi/parser": "^2.0.0-next-major.8",
"@openapi-contrib/openapi-schema-to-json-schema": "^3.2.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be pinned to ~3.2.0. See asyncapi/generator#927

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do the change but I have no permission on your branch @magicmatatjahu

@smoya smoya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smoya

smoya commented Apr 11, 2023

Copy link
Copy Markdown
Member

@fmvilas @derberg please approve when you have a chance. Last change was just the fix on dependencies

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@smoya

smoya commented Apr 28, 2023

Copy link
Copy Markdown
Member

/rtm

@asyncapi-bot
asyncapi-bot merged commit 2056509 into asyncapi:master Apr 28, 2023
smoya added a commit to smoya/openapi-schema-parser that referenced this pull request Apr 28, 2023
@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move OpenAPI Schema parser (TS version) back from parser-js 2.0 to this repo

5 participants