spec icon indicating copy to clipboard operation
spec copied to clipboard

Servers Object Question

Open VisualBean opened this issue 3 years ago • 4 comments

Is the Servers object, to be considered an Object or a Collection?

... we want to keep as much compatibility as possible with the OpenAPI Specification.

Looking at the OpenAPI Documentation, Servers can be either a single object

{
  "url": "https://development.gigantic-server.com/v1",
  "description": "Development server"
}

or a collection

{
  "servers": [ // Notice the array notation..
    {
      "url": "https://development.gigantic-server.com/v1",
      "description": "Development server"
    },
    {
      "url": "https://staging.gigantic-server.com/v1",
      "description": "Staging server"
    },
    {
      "url": "https://api.gigantic-server.com/v1",
      "description": "Production server"
    }
  ]
}

But looking at the documentation for AsyncAPI it is always an object.

{
  "servers": { // No array notation, rather an object with multiple properties.
    "development": { 
      "url": "development.gigantic-server.com",
      "description": "Development server",
      "protocol": "amqp",
      "protocolVersion": "0.9.1"
    },
    "staging": {
      "url": "staging.gigantic-server.com",
      "description": "Staging server",
      "protocol": "amqp",
      "protocolVersion": "0.9.1"
    },
    "production": {
      "url": "api.gigantic-server.com",
      "description": "Production server",
      "protocol": "amqp",
      "protocolVersion": "0.9.1"
    }
  }
}

Is it merely a documentation mistake, or is it to be consideren an object always?

  • I was hoping that AsyncAPI would stay consistent with OpenAPI for most of the "same" metadata structures.

(working on a (de)serializer for dotnet)

VisualBean avatar Jun 13 '22 08:06 VisualBean

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

github-actions[bot] avatar Jun 13 '22 08:06 github-actions[bot]

@VisualBean Hi! Servers in the AsyncAPI are a map, where the key is the "name" of the server and the value is the detail of server. We don't use semantic from OpenAPI in servers section.

magicmatatjahu avatar Jun 13 '22 08:06 magicmatatjahu

Thank you for the quick reply

VisualBean avatar Jun 13 '22 08:06 VisualBean

@VisualBean No problem :) I think that we can close that issue, yes?

For you know, we try to reuse the object structures from OpenAPI, but our servers have information about the protocol, its version and bindings and this structure has to be different than OpenAPI introduces.

@derberg Could you close it?

magicmatatjahu avatar Jun 13 '22 08:06 magicmatatjahu

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Oct 12 '22 00:10 github-actions[bot]