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

Wrong expanded refract for the circular enums #590

Open
pksunkara opened this issue Aug 21, 2018 · 1 comment
Open

Wrong expanded refract for the circular enums #590

pksunkara opened this issue Aug 21, 2018 · 1 comment

Comments

@pksunkara
Copy link
Contributor

## GET /
+ Response 200 (application/json)
    + Attributes (array)
        - (A)
        - (B)

## Data Structures

## A (enum)
- (B)
- (array[B])

## B (enum)
- (A)
- (array[A])

The generated expanded refract looks wrong.

@pksunkara pksunkara added this to the 4.1.0 milestone Aug 21, 2018
@kylef
Copy link
Member

kylef commented Sep 28, 2020

Drafter 5.0.0 produces the following output:

{
  "element": "dataStructure",
  "content": {
    "element": "array",
    "content": [
      {
        "element": "A"
      },
      {
        "element": "B"
      }
    ]
  }
}

Where A is defined as:

{
  "element": "dataStructure",
  "content": {
    "element": "enum",
    "meta": {
      "id": {
        "element": "string",
        "content": "A"
      }
    },
    "attributes": {
      "enumerations": {
        "element": "array",
        "content": [
          {
            "element": "B"
          },
          {
            "element": "array",
            "content": [
              {
                "element": "B"
              }
            ]
          }
        ]
      }
    }
  }
}

B is defined as:

{
  "element": "dataStructure",
  "content": {
    "element": "enum",
    "meta": {
      "id": {
        "element": "string",
        "content": "B"
      }
    },
    "attributes": {
      "enumerations": {
        "element": "array",
        "content": [
          {
            "element": "A"
          },
          {
            "element": "array",
            "content": [
              {
                "element": "A"
              }
            ]
          }
        ]
      }
    }
  }
}

Which looks correct, expansion must not be working for circular nature of this API Blueprint.

@kylef kylef removed this from the 4.1.0 milestone Sep 28, 2020
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

No branches or pull requests

2 participants