GithubHelp home page GithubHelp logo

Comments (7)

marianobntz avatar marianobntz commented on July 16, 2024

Update
This comment is wrong, $schema and $ref are different things...
Anyway... when I use a $ref keyword referencing an external file I get the error... I tried different combinations:

  • "$ref": "components/schemas/type.json"
  • "$ref": "components/schemas/type.json#"

type.json is:

{
"type": "string",
"description": "dummy",
"pattern": "^[a-z0-9\-]+$",
"example": "supplier"
}

  • tried changing the type.json to (this is a sample, maybe I got a syntax error in this sample):

{ "components": { "schemas": { "record": {
"type": "string",
"description": "dummy",
"pattern": "^[a-z0-9\-]+$",
"example": "supplier"
}}}}

and tested

  • "$ref": "components/schemas/type.json#/components/schemas/record"

But no luck..

Original comment
After some debuging I discovered that in asyncapi schema references use the $schema keyword instead of $ref that is used in openapi.
It would be nice to have a lint check and better information when discovering this problem.

Thanks

from redocly-cli.

tatomyr avatar tatomyr commented on July 16, 2024

Hi @marianobntz, this looks like a bug. Where did you put the $ref?

from redocly-cli.

marianobntz avatar marianobntz commented on July 16, 2024

Tried to put the $ref in a message payload directly in a channel, inside a reusable component under components/messages with no luck.

from redocly-cli.

marianobntz avatar marianobntz commented on July 16, 2024

weird thing is that the lint command supports the external ref, it is just the bundle command who breaks...

from redocly-cli.

lornajane avatar lornajane commented on July 16, 2024

I'm sorry, only the lint command supports AsyncAPI (v2.6) at the moment. Bundle doesn't have AsyncAPI support yet (for any version)

from redocly-cli.

marianobntz avatar marianobntz commented on July 16, 2024

ok.. can I change the issue title to "support bundle for asyncapi documents?" 😄

bundle actually works if you do not use the external $ref

from redocly-cli.

tatomyr avatar tatomyr commented on July 16, 2024

bundle actually works if you do not use the external $ref

It also works for external $refs from some specific places (like channel servers and message examples). So at first I thought the bundle command was implemented 🙈. But yes, it needs to be implemented separately.

from redocly-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.