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

Traits can be defined as double arrays #273

Closed
jonaslagoni opened this issue Oct 11, 2022 · 6 comments · Fixed by #339
Closed

Traits can be defined as double arrays #273

jonaslagoni opened this issue Oct 11, 2022 · 6 comments · Fixed by #339
Labels
bug Something isn't working good first issue Good for newcomers Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com released on @next-major-spec released stale

Comments

@jonaslagoni
Copy link
Member

Describe the bug

I just noticed that the operation traits https://github.com/asyncapi/spec-json-schemas/blob/master/definitions/2.5.0/operation.json#L13 can be defined with a double array:

{
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "http://asyncapi.com/definitions/2.5.0/Reference.json"
          },
          {
            "$ref": "http://asyncapi.com/definitions/2.5.0/operationTrait.json"
          },
          {
            "type": "array",
            "items": [
              {
                "oneOf": [
                  {
                    "$ref": "http://asyncapi.com/definitions/2.5.0/Reference.json"
                  },
                  {
                    "$ref": "http://asyncapi.com/definitions/2.5.0/operationTrait.json"
                  }
                ]
              },
              {
                "type": "object",
                "additionalItems": true
              }
            ]
          }
        ]
      }
    }

I don't think this is the intended behavior as it allows you to define traits such as:

asyncapi: 2.5.0
info:
  title: Account Service
  version: 1.0.0
  description: This service is in charge of processing user signups
channels:
  user/signedup:
    subscribe:
      traits: [[{summary: 'test'}]]
@derberg
Copy link
Member

derberg commented Oct 12, 2022

yeah, I was also confused seeing this structure when I was checking additionalItems for the other issue. I could not figure out with blame why it was added. I know @fmvilas added it but it was time when things changed sometimes without PRs.

@fmvilas do you remember why it was done like this?

@derberg
Copy link
Member

derberg commented Oct 12, 2022

@fmvilas
Copy link
Member

fmvilas commented Oct 14, 2022

No, I honestly don't remember but it's clearly a bug.

@derberg derberg added good first issue Good for newcomers Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com labels Oct 18, 2022
@github-actions
Copy link

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

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 ❤️

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 4.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 5.0.0-next-major-spec.18 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com released on @next-major-spec released stale
Projects
None yet
4 participants