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

docs: new guide for message validation #1005

Merged
merged 121 commits into from Feb 24, 2023
Merged

Conversation

starlightknown
Copy link
Contributor

@starlightknown starlightknown commented Oct 6, 2022

Description

  • New guide for validation of AsyncAPI message validation

Related issue(s)

Fixes #994

@netlify
Copy link

netlify bot commented Oct 6, 2022

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5ba8792
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/63f939152c7bf900084ff590
😎 Deploy Preview https://deploy-preview-1005--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@starlightknown starlightknown changed the title docs: NEW Guide for message validation docs: new guide for message validation Oct 6, 2022
@starlightknown
Copy link
Contributor Author

starlightknown commented Oct 6, 2022

  • remove git, mention npm instead of node
  • validator and gateway getting started in prerequisites, link installation
  • two different ways, link repos
  • additional resources, studio and blog post asyncapi
  • asyncapi schema validator
  • header 1 scenarios, header 2 scenarios, header 3 examples
  • validatemessage id example, shorten example headings

@alequetzalli
Copy link
Member

@akshatnema Heyo, can you help Karuna here? She is trying to figure out why her builds are failing and not generating the Netlify preview 😄✌🏽

Copy link
Member

@akshatnema akshatnema left a comment

Choose a reason for hiding this comment

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

@starlightknown You forgot the escape characters before the string literal where you want to highlight the text.

pages/docs/guides/message-validation.md Outdated Show resolved Hide resolved
pages/docs/guides/message-validation.md Outdated Show resolved Hide resolved
starlightknown and others added 2 commits October 6, 2022 23:56
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 56
🟠 Accessibility 88
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://deploy-preview-1005--asyncapi-website.netlify.app/

@starlightknown
Copy link
Contributor Author

Thanks a lot! @akshatnema I'd still be searching for { because that's what logs showed

Copy link
Member

@alequetzalli alequetzalli left a comment

Choose a reason for hiding this comment

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

@starlightknown I re-wrote your guide because:

  • there was a lot of duplicate content, all over the place (this made it hard to follow)
  • the writing was too verbose; for guides/tutorial steps, you should always focus on starting sentences with verbs for each individual action
  • there were many grammar and punctuation errors (You must always run your written content through Grammarly first BEFORE you request reviews)

TO DO:

  • I think we have indentation issues in the code snippets added. Please go through all the code snippets and fix as needed 😄✌🏽.
  • Are there "additional resources" we could add to help the user? If so, please add them to the end of your doc (I already added that header section)

@alequetzalli
Copy link
Member

Hey @derberg, this is ready for technical review! I made a draft update, so I hope I didn't add technical mistakes 😂

Comment on lines 2 to 3
title: Validate Messages/Events
description: This guide explains two ways to validate messages/events in AsyncAPI documents.
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
title: Validate Messages/Events
description: This guide explains two ways to validate messages/events in AsyncAPI documents.
title: Validate Messages/Events in runtime
description: This guide explains different use cases for messages/events validation using AsyncAPI.

This should be a guide where we just explain different ways of doing things. Now it sounds like the only tools out there are asyncapi-validator and event gateway. The goal should not be to promote them and explain how to use them (that for example Nodejs is needed, or that npm i must be run. The goal is to highlight that there are many different ways people approach message validation.

you can start with a diagram showing producer-broker-producer and say "blabla validation can occur on any stage of the flow" and then:

  • section: Validation inside producer and consumer -> It could start with the same diagram, but somehow marked what components are critical for that section. And you explain that validation of incoming and outgoing messages can be an integral part of the application. Your AsyncAPI file should contain descriptions of payload schemas, so you can read these in your application, and validate messages that are consumed by the application and also produced. -> and then asyncapi-validator comes into play, as just one example of how this could be done. That there is Nodejs library that allows you to pass AsyncAPI file to it, and get validation methods. But no need to install nodejs or the package itself, it is a guide that should just highlight one possible reference implementation.
  • section: Validation in a gateway -> It is not so important to show example AsyncAPI file. More important is to show diagram, the same that was in intro, but with additional component - event gateway (this is something you need to consult with @smoya as I do not remember if this gateway is standalone next to broker or rather a side care to the producer/consumer). And you just explain that the advantage is that validation is delegated to central component. And brought explain on our event gateway example how this could work.
  • section: Native broker validation -> here another diagram, showing that validation requests go out from broker to schema registry. You write that this is common for Kafka broker. In such cases AsyncAPI is not part of the flow, but still plays an important role, because in AsyncAPI document you can still reference the payload schemas stored in the schema registry instead of duplicating them in AsyncAPI document -> example https://github.com/asyncapi/avro-schema-parser#use-them-on-your-asyncapi-document and you can explicitly document where is the schema registry located https://github.com/asyncapi/bindings/tree/master/kafka#server-binding-object

so a bit of refactor is needed

I'm happy to hop on a call if you need me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey, yes so is it possible to get on group call with you and @smoya ? I have questions related to studio and event gateway too plus I need some help with code snippets here.

Copy link
Member

Choose a reason for hiding this comment

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

hey, yes so is it possible to get on group call with you and @smoya ? I have questions related to studio and event gateway too plus I need some help with code snippets here.

Just for the record, this happened today.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
akshatnema
akshatnema previously approved these changes Feb 2, 2023
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

tiny suggestions left

pages/docs/guides/message-validation.md Outdated Show resolved Hide resolved
pages/docs/guides/message-validation.md Outdated Show resolved Hide resolved
pages/docs/guides/message-validation.md Outdated Show resolved Hide resolved
@derberg
Copy link
Member

derberg commented Feb 8, 2023

@alequetzalli I left some final comments yesterday, please have a look

Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
starlightknown and others added 3 commits February 8, 2023 14:18
Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
derberg
derberg previously approved these changes Feb 8, 2023
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

superb work!!!

Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>
@alequetzalli
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit 869d3c8 into asyncapi:master Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. 📑 docs gsod This label should be used for issues or discussions related to ideas for Google Season of Docs ready-to-merge
Projects
Status: Done 🚀
AsyncAPI Docs Board
  
Community PR under Review 🧐
Development

Successfully merging this pull request may close these issues.

[📑 Docs]: add 5th content bucket to docs for guides
6 participants