Skip to content

Union enum types missing information about enums #38

Description

@deiteris

When enum is put in a union (or JSON schema enum with multiple types), the information about the enum is lost.

#%RAML 1.0
title: Test API
version: v1
mediaType: 'application/json'
protocols:
    - HTTPS

types:
  TestType: |
    {
        "type": ["string", "null"],
        "enum": ["test", null]
    }

While with JSON schema it's possible to understand what the values are (see the first screenshot below), with RAML union type the example is not rendered at all.
image

#%RAML 1.0
title: Test API
version: v1
mediaType: 'application/json'
protocols:
    - HTTPS

types:
  TestType:
    type: string | integer
    enum: [5, "test", 1, "three"]

image

See "RAML 1.0 spec: Union type" section that demonstrates the same usage example: https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#union-type

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions