Skip to content

Fields with multiple types are displayed incorrectly #597

@dleflohic

Description

@dleflohic

Describe the bug
The type of fields that have a schema like below appears as stringnull in https://playground.open-rpc.org/:

"type": [
  "string",
  "null"
]

Note: the schema is following the current latest specification of Json schema: https://json-schema.org/draft/2020-12/json-schema-validation.html#name-type

To Reproduce
Copy/paste the following json:

{
  "openrpc": "1.2.1",
  "info": {
    "version": "0.1.0-SNAPSHOT",
    "title": "Example"
  },
  "methods": [
    {
      "name": "my_endpoint",
      "params": [],
      "result": {
        "name": "response",
        "schema": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  ]
}

Expected behavior
Information about the type are displayed in a prettier and correct way, without concatenated the types.

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