Skip to content

refactor: add migration function from v2 to v1 API #607

New issue

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

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

Already on GitHub? # to your account

Merged

Conversation

magicmatatjahu
Copy link
Member

@magicmatatjahu magicmatatjahu commented Sep 13, 2022

Description

  • add new iterator for v1 API - due to fact that old AsyncAPIDocument exposes traverse function in one of the method we need to create another traverse function for schemas written in v1 API.
  • create migration function from v1 to v2 API and expose it .
  • add anonymous naming for schemas and messages.
  • add unit tests
  • update Readme.md.
  • return document not parsed from parser.parse() function.

cc @smoya

Related issue(s)
Part of #481
Part of #482

@magicmatatjahu magicmatatjahu added the enhancement New feature or request label Sep 13, 2022
@magicmatatjahu magicmatatjahu mentioned this pull request Sep 13, 2022
20 tasks
@magicmatatjahu magicmatatjahu marked this pull request as ready for review September 14, 2022 10:43
@@ -14,4 +15,36 @@ export class ExternalDocs extends SpecificationExtensionsModel<v2.ExternalDocume
description() {
return description(this);
}

hasExtensions() {
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 had to do that due to circular references between tag, externalDocs and mixins files.

@@ -22,4 +23,36 @@ export class Tag extends SpecificationExtensionsModel<v2.TagObject> {
hasExternalDocs() {
return hasExternalDocs(this);
}

hasExtensions() {
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 had to do that due to circular references between tag, externalDocs and mixins files.

@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
No Duplication information No Duplication information

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.

LGTM! 🚀🌔 Great addition!

@magicmatatjahu
Copy link
Member Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 1265ae6 into asyncapi:next-major Sep 15, 2022
@magicmatatjahu magicmatatjahu deleted the next/migrator-function branch September 15, 2022 07:21
magicmatatjahu added a commit to magicmatatjahu/parser-js that referenced this pull request Oct 3, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request ready-to-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants