Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 14 commits into from
Apr 28, 2023

Conversation

magicmatatjahu
Copy link
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

src/index.ts Outdated
return result;
}

async function parse(input: ParseSchemaInput<unknown, unknown>): Promise<v2.SchemaObject> {
Copy link
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
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
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

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
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';

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
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
Copy link
Member

smoya commented Oct 20, 2022

@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
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
Copy link
Member

smoya commented Nov 8, 2022

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

Copy link
Member

@fmvilas fmvilas left a comment

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.

CODEOWNERS Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

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
Copy link
Member

derberg commented Nov 14, 2022

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
Copy link
Member Author

magicmatatjahu commented Nov 14, 2022

@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

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
Copy link
Member

smoya commented Mar 15, 2023

relevant

@smoya
Copy link
Member

smoya commented Mar 15, 2023

@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
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
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
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

Copy link
Member

@smoya smoya left a comment

Choose a reason for hiding this comment

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

@smoya
Copy link
Member

smoya commented Apr 11, 2023

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

@sonarqubecloud
Copy link

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
Copy link
Member

smoya commented Apr 28, 2023

/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
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