Skip to content

feat(multi format schema): support new media types #569

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pakisan
Copy link
Member

@Pakisan Pakisan commented Feb 27, 2025

  • application/raml+yaml;version=1.0
  • application/vnd.google.protobuf;version=2
  • application/vnd.google.protobuf;version=3
  • application/xml

Closes asyncapi/jasyncapi#214

Let's left them like ref, string or object. Generally idk which schema will represent them correctly

- application/raml+yaml;version=1.0
- application/vnd.google.protobuf;version=2
- application/vnd.google.protobuf;version=3
- application/xml
Copy link

"application/vnd.google.protobuf;version=2",
"application/vnd.google.protobuf;version=3",

"application/xml"
Copy link
Member

Choose a reason for hiding this comment

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

do we need it here? in the end, it works without it listed here right? in the spec xml is not listed in the list of recommeneded schemas - and also, it is anyway just recommended

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, otherwise here will be error

image

asyncapi: 3.0.0
info:
  title: Account Service
  version: 1.0.0
  description: This service is in charge of processing user signups
channels:
  userSignedUp:
    address: user/signedup
    messages:
      UserSignedUp:
        $ref: '#/components/messages/userSignedUp'
operations:
  sendUserSignedUp:
    action: send
    channel:
      $ref: '#/channels/userSignedUp'
    messages:
      - $ref: '#/channels/userSignedUp/messages/UserSignedUp'
components:
  messages:
    userSignedUp:
      payload:
        schemaFormat: application/xml
        schema: |
          <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
            <xs:element name="User">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="displayName" type="xs:string">
                      <xs:annotation>
                        <xs:documentation>Name of the user</xs:documentation>
                      </xs:annotation>
                  </xs:element>
                  <xs:element name="email" type="xs:string">
                      <xs:annotation>
                        <xs:documentation>Email of the user</xs:documentation>
                      </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:schema>

Copy link
Member Author

Choose a reason for hiding this comment

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

it is anyway just recommended

Yep, it's recommendation. But folks from Specmatic already have scenarios where they are using .xsd as payload schema

Without proper registration UI component will not work because of error in our parser

Error thrown during AsyncAPI document parsing. Name: Error, message: Unknown schema format

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

2 participants