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

Union enum types missing information about enums #38

Open
deiteris opened this issue Sep 8, 2021 · 0 comments
Open

Union enum types missing information about enums #38

deiteris opened this issue Sep 8, 2021 · 0 comments

Comments

@deiteris
Copy link
Contributor

deiteris commented Sep 8, 2021

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

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

1 participant