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

Duplicit value in enumeration #749

Closed
sixeyes opened this issue Sep 17, 2019 · 2 comments · Fixed by #754
Closed

Duplicit value in enumeration #749

sixeyes opened this issue Sep 17, 2019 · 2 comments · Fixed by #754
Labels

Comments

@sixeyes
Copy link

sixeyes commented Sep 17, 2019

I've been busy with other projects for the last few months but returned to work on my API docs and discovered I now have 16 semantic errors, even though I've not changed the document. The errors are all:

Duplicit value in enumeration
Line xxxx API Blueprint

They all refer to enumerations declared in Data Structures section

# Data Structures
## WaveRecord (object)

+ status: `Processed` (enum, required) - The wave status.
    + Members
        + `Draft` - The wave has been created but not queued.
        + `Processed` - The wave has been processed.
        + `Queued` - The wave has been queued but not processed.

The error line xxxx in this example refers to the + status: line. If I remove the Processed value I get an error indicating I've not supplied a value.

At the moment it's just a semantic error, but I'd like to know what's changed and what I can do to fix the warnings.

@kylef kylef transferred this issue from apiaryio/api-blueprint Sep 18, 2019
@kylef
Copy link
Member

kylef commented Sep 18, 2019

Hi @sixeyes, I think this looks like a bug in the parser (Drafter). Thank you for reporting, we'll debug this further and get the the bottom of the problem, for now I think you can ignore these warnings in your document.

@kylef kylef added the bug label Sep 18, 2019
@kylef
Copy link
Member

kylef commented Sep 24, 2019

Parse Result:

{
                        "element": "enum",
                        "attributes": {
                          "enumerations": {
                            "element": "array",
                            "content": [
                              {
                                "element": "string",
                                "attributes": {
                                  "typeAttributes": {
                                    "element": "array",
                                    "content": [
                                      {
                                        "element": "string",
                                        "content": "fixed"
                                      }
                                    ]
                                  }
                                },
                                "content": "Processed"
                              },
                              {
                                "element": "string",
                                "meta": {
                                  "description": {
                                    "element": "string",
                                    "content": "The wave has been created but not queued."
                                  }
                                },
                                "attributes": {
                                  "typeAttributes": {
                                    "element": "array",
                                    "content": [
                                      {
                                        "element": "string",
                                        "content": "fixed"
                                      }
                                    ]
                                  }
                                },
                                "content": "Draft"
                              },
                              {
                                "element": "string",
                                "meta": {
                                  "description": {
                                    "element": "string",
                                    "content": "The wave has been queued but not processed."
                                  }
                                },
                                "attributes": {
                                  "typeAttributes": {
                                    "element": "array",
                                    "content": [
                                      {
                                        "element": "string",
                                        "content": "fixed"
                                      }
                                    ]
                                  }
                                },
                                "content": "Queued"
                              }
                            ]
                          }
                        },
                        "content": {
                          "element": "string",
                          "attributes": {
                            "typeAttributes": {
                              "element": "array",
                              "content": [
                                {
                                  "element": "string",
                                  "content": "fixed"
                                }
                              ]
                            }
                          },
                          "content": "Processed"
                        }
                      }
                    }

Actual:

element: enum
attributes:
  enumerations:
    - `Processed`
    - `Draft` - The wave has been created but not queued.
    - `Queued` - The wave has been queued but not processed.
content:
  element: string
  content: Processed

Expectation:

element: enum
attributes:
  enumerations:
    - `Draft` - The wave has been created but not queued.
    - `Processed` - The wave has been processed.
    - `Queued` - The wave has been queued but not processed.
content:
  element: string
  content: Processed

@klokane klokane mentioned this issue Oct 8, 2019
@kylef kylef mentioned this issue Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants