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

Custom schema format produces an error #460

Closed
jonaslagoni opened this issue Oct 18, 2022 · 6 comments
Closed

Custom schema format produces an error #460

jonaslagoni opened this issue Oct 18, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@jonaslagoni
Copy link
Member

Describe the bug

Custom schemaFormat gives the following error: T[String(...)] is not a function

Use the following AsyncAPI document:

asyncapi: '2.5.0'
info:
  title: Backend service API
  version: '1.0.0'
  description: |
    This is the website backend service that interact with users.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0

servers:
  development:
    url: 0.0.0.0:1883
    protocol: mqtt
    description: Local development broker

channels:
  management/new/product:
    description: New order being placed
    publish:
      operationId: consumeNewProduct
      message:
        $ref: '#/components/messages/NewProductMessage'

components:
  messages:
    NewProductMessage:
      name: newProductMessage
      title: New product message
      summary: When a new product has been created.
      schemaFormat: application/schema+json;version=draft-2019-09
      payload:
        type: string
@jonaslagoni jonaslagoni added the bug Something isn't working label Oct 18, 2022
@JhoanAlvear
Copy link

can i help with this issue

@JhoanAlvear
Copy link

@jonaslagoni you need register custom schemaformt with method registerSchemaParser

@jonaslagoni
Copy link
Member Author

@JhoanAlvear IMO the Studio should be able to understand AsyncAPI documents with custom schemas, that is not one of the supported ones, without giving an error 🙂

@magicmatatjahu any guidance you can add to solving it?

@magicmatatjahu
Copy link
Member

@jonaslagoni @JhoanAlvear I understand that given error message is misunderstood, but we shouldn't change error's message based on JS error's message, so we should handle that problem in the parser-js side. We have PR for that asyncapi/parser-js#449. Also when we will merge it #434 we will see these errors:

image

So I think that we can close that issue, wdyt?

@jonaslagoni
Copy link
Member Author

Up to you if you want to leave it or remove it, technically it's not solved, so I would probably say leave it 😄

@magicmatatjahu
Copy link
Member

Fixed by #434 PR

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants