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 Protobuf schemas #888

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

Amzani
Copy link
Collaborator

@Amzani Amzani commented Dec 11, 2023

Fixes #885

Works with this document

asyncapi: 3.0.0

info:
  title: Service
  version: 1.0.0
  contact:
    name: Developers
    email: [email protected]

servers:
  development:
    host: localhost:9092
    protocol: kafka
    protocolVersion: 2.6.0
    description: Development Kafka broker.

channels:
  in:
    address: in
    title: Inbox channel
    description: This is the topic for all messages that the Account Service is
      meant to process.
    messages:
      createUser:
        $ref: "#/components/messages/CreateUser"
    servers:
      - $ref: "#/servers/development"

components:
  messages:
    CreateUser:
      name: CreateUser
      summary: A command for creating a user.
      tags:
        - name: Users
      contentType: application/vnd.google.protobuf;version=3
      traits:
        - $ref: "#/components/messageTraits/CloudEventHeaders"
      headers:
        type: object
        properties:
          correlationId:
            description: Correlation ID set by the application.
            type: string
            format: uuid
      correlationId:
        description: Default Correlation ID.
        location: $message.header#/correlationId
      payload:
        schemaFormat: application/vnd.google.protobuf;version=3
        payload: |
            message Point {
                required int32 x = 1;
                required int32 y = 2;
                optional string label = 3;
            }

            message Line {
                required Point start = 1;
                required Point end = 2;
                optional string label = 3;
            }
  messageTraits:
    CloudEventHeaders:
      headers:
        type: object
        required:
          - ce-specversion
          - ce-id
          - ce-source
          - ce-type
        properties:
          ce-specversion:
            type: string
            description: The version of the CloudEvents specification which the
              event uses.
            enum:
              - "1.0"
          ce-id:
            type: string
            minLength: 1
            description: Identifies the event.
          ce-source:
            type: string
            format: uri-reference
            minLength: 1
            description: Identifies the context in which an event happened.
          ce-type:
            type: string
            minLength: 1
            description: Describes the type of event related to the originating
              occurrence.
          ce-datacontenttype:
            type: string
            description: Content type of the data value. Must adhere to
              RFC 2046 format.
          ce-dataschema:
            type: string
            description: Identifies the schema that data adheres to.
          ce-subject:
            type: string
            description: Describes the subject of the event in the context of
              the event producer (identified by source).
          ce-time:
            type: string
            format: date-time
            description: Timestamp of when the occurrence happened.
              Must adhere to RFC 3339.
          content-type:
            type: string
            enum:
              - application/json

Copy link

changeset-bot bot commented Dec 11, 2023

⚠️ No Changeset found

Latest commit: c897f37

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

netlify bot commented Dec 11, 2023

Deploy Preview for modest-rosalind-098b67 ready!

Name Link
🔨 Latest commit c897f37
🔍 Latest deploy log https://app.netlify.com/sites/modest-rosalind-098b67/deploys/657833e52cd1c000081bdebd
😎 Deploy Preview https://deploy-preview-888--modest-rosalind-098b67.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 configuration.

Copy link

netlify bot commented Dec 11, 2023

Deploy Preview for asyncapi-studio-design-system ready!

Name Link
🔨 Latest commit c897f37
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-studio-design-system/deploys/657833e5ef82700008bf53ea
😎 Deploy Preview https://deploy-preview-888--asyncapi-studio-design-system.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 configuration.

@Amzani Amzani mentioned this pull request Dec 11, 2023
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

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 👍

@Amzani
Copy link
Collaborator Author

Amzani commented Dec 12, 2023

/rtm

@asyncapi-bot asyncapi-bot merged commit b81aeaa into asyncapi:master Dec 12, 2023
20 checks passed
@Amzani Amzani changed the title feat: Support Avro schemas feat: Support Protobuf schemas Dec 12, 2023
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.

Protobuf not rendering
3 participants