Skip to content

How to re-order anyOf items with ui-schema? #4298

@perelin

Description

@perelin

Prerequisites

What theme are you using?

core

What is your question?

I have an anyOf array that is used to render a dropdown list. Now I want to change the order of the list elements with ui.schema (we cant change the actual json-schema files, they come from somewhere else). How can I do this?

Example:

{
  "anyOf": [
    {
      "const": "OPTION1",
      "title": "op1"
    },
    {
      "const": "OPTION2",
      "title": "op2"
    },
    {
      "const": "OPTION3",
      "title": "op3"
    }
  ],
  "type": "string"
}

How can I reorder them to eg [op3, op1, op2]?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions