Add possible values for data types

Created on 10 January 2023, over 1 year ago
Updated 27 October 2023, 8 months ago

Problem/Motivation

The resource URL for a content entity bundle shows possible values for fields which are lists:

                "my_field": {
                    "type": "string",
                    "title": "Type",
                    "oneOf": [
                        {
                            "const": "one",
                            "title": "One"
                        },
                        {
                            "const": "two",
                            "title": "Two"
                        }
                    ]
                }

However, if a config entity uses a data type which has options (if the DataType plugin implements OptionsProviderInterface), then that doesn't show in the schema.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    I wanted to bring attention to this new issue I just opened, which aims to improve the current allowed_values logic so that it supports any field that implements OptionsProviderInterface.

    ✨ Use OptionsProviderInterface::getPossibleOptions() for allowed field values (anyOf / oneOf) Needs review

    While working on that, I came across this issue, which I noticed also uses getPossibleOptions(), but for a different case.

    I'm not sure if it would be possible to merge our logic together somehow, to cover all cases where getPossibleOptions() is needed. But I figured I would at least start by cross-linking the issues so everyone is aware of both. :-)

Production build 0.69.0 2024