Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants