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

Updated asyncapi v2 typings to conform to JSON Schema draft-07 #1608

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

jeremyfiel
Copy link
Contributor

@jeremyfiel jeremyfiel commented Jul 3, 2024

Refactors the v2 typings ONLY.

Per the specification, AsyncAPI v2 supports a superset of JSON Schema draft-07.

related Redocly/redoc#1219

What/Why/How?

The types defined in asyncapi.ts were copied from oas3_1 types but AsyncAPI does not support JSON Schema 2020-12, thus, many of the typings were invalid for proper validation and linting.

Reference

https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#schema-object

the list defined in their docs does not represent the terminology they have used. The list is copied from their earlier version specification documents and only minor updates were made. They indicate any JSON Schema core or validation keywords are supported from draft-07, so those updates were integrated here.

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@jeremyfiel jeremyfiel requested review from a team as code owners July 3, 2024 22:12
Copy link

changeset-bot bot commented Jul 3, 2024

🦋 Changeset detected

Latest commit: cd4c5ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jeremyfiel jeremyfiel force-pushed the refactor/asyncapi-types branch 2 times, most recently from 0c7d0b7 to 019ba1a Compare July 3, 2024 23:25
@tatomyr
Copy link
Contributor

tatomyr commented Jul 5, 2024

@jeremyfiel could you re-arrange the properties back just to see what's been changed?

@tatomyr tatomyr mentioned this pull request Jul 10, 2024
5 tasks
@jeremyfiel jeremyfiel requested a review from tatomyr July 16, 2024 16:27
@jeremyfiel jeremyfiel force-pushed the refactor/asyncapi-types branch 2 times, most recently from b02db39 to 8fe4023 Compare July 16, 2024 18:28
Copy link
Contributor

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @jeremyfiel!

@tatomyr tatomyr merged commit b192ad9 into Redocly:main Jul 17, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants