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: support 2.1.0 spec version #129

Merged
merged 5 commits into from
Jun 29, 2021

Conversation

magicmatatjahu
Copy link
Member

@magicmatatjahu magicmatatjahu commented Jun 25, 2021

Description

Support 2.1.0 spec version:

  • render the new shape of message's examples with name and summary.

Example using the gemini example:

> Examples of payload

**updateMessage**

Example of an update message that contains a change in price information.

```json
{
  "type": "update",
  "eventId": 36902233362,
  "timestamp": 1619769673,
  "timestampms": 1619769673527,
  "socket_sequence": 661,
  "events": [
    {
      "type": "change",
      "side": "bid",
      "price": "54350.40",
      "remaining": "0.002",
      "delta": "0.002",
      "reason": "place"
    }
  ]
}
``


**heartbeatMessage**

Example of additional heartbeat message when you enable them.

```json
{
  "type": "heartbeat",
  "socket_sequence": 1656
}
``

Related issue(s)
Part of asyncapi/spec#536

@magicmatatjahu magicmatatjahu added the enhancement New feature or request label Jun 25, 2021
@@ -1,7 +1,8 @@
import { Text } from "@asyncapi/generator-react-sdk";
import { generateExample, getHeadersExamples, getPayloadExamples } from "@asyncapi/generator-filters";
Copy link
Member

Choose a reason for hiding this comment

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

can you explain this change to a custom functions

Copy link
Member Author

Choose a reason for hiding this comment

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

getHeadersExamples or getPayloadExamples only return the examples[*].headers or examples[*].payload, so we don't have corresponding name or summary for appropriate example. If we will have change from PR in @asyncapi/generator-filters we must know that then it's a breaking change and we must update check all templates where we use the getHeadersExamples and getPayloadExamples. Making changes only here is safe.

Copy link
Member

Choose a reason for hiding this comment

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

getHeadersExamples or getPayloadExamples are more than what you wrote, if examples are not in examples object, they are taken from payload or headers schema (if provided of course).

we can release generator-filters 2.0 🤷🏼 unless you already have your own versions of these functions in react component. Then we are just looking an effort we did in the past to move generic functions to @asyncapi/generator-filters

Copy link
Member Author

@magicmatatjahu magicmatatjahu Jun 25, 2021

Choose a reason for hiding this comment

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

getHeadersExamples or getPayloadExamples are more than what you wrote, if examples are not in examples object, they are taken from payload or headers schema (if provided of course).

Functions in PR also are looking for that :)

we can release generator-filters 2.0 🤷🏼 unless you already have your own versions of these functions in react component. Then we are just looking an effort we did in the past to move generic functions to @asyncapi/generator-filters

So I will create PR in generator-filters.

Copy link
Member Author

Choose a reason for hiding this comment

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

@magicmatatjahu magicmatatjahu marked this pull request as ready for review June 29, 2021 11:48
derberg
derberg previously approved these changes Jun 29, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jun 29, 2021

Kudos, SonarCloud 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

@magicmatatjahu magicmatatjahu merged commit 7797667 into asyncapi:master Jun 29, 2021
@magicmatatjahu magicmatatjahu deleted the support-2.1.0 branch June 29, 2021 12:07
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.14.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
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants