只有字符串的数据结构

Data structure with string only

我正在尝试创建数据结构

# Data Structures

## Incorrect Credentials (string) 
    - `Insufficient privileges.`

这是它将被使用的地方:

+ Response 401 (application/vnd.api+json)

    Not allowed.

    + Attributes (object)
        + errors (array[Incorrect Credentials])

这是它的输出。我正在尝试将 "Hello, world!" 替换为 "Insufficient privileges."。

只需将字符串更改为 enum 即可解决问题。从原始类型继承时,您不能设置默认值。

# API
# A [GET /]

+ Response 401 (application/vnd.api+json)

    Not allowed.

    + Attributes (object)
        + errors (array[Incorrect Credentials])


# Data Structures

## Incorrect Credentials (enum)
- Insufficient privileges.