Search code examples
apiblueprint

Data structure with string only


I'm trying to create a Data Structure

# Data Structures

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

This is where it will be used:

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

    Not allowed.

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

This is what it outputs. I'm trying to replace the "Hello, world!" with "Insufficient privileges.".

enter image description here


Solution

  • Just changing the string to enum should solve it. When inheriting from primitive types you can't set a default value.

    # API
    # A [GET /]
    
    + Response 401 (application/vnd.api+json)
    
        Not allowed.
    
        + Attributes (object)
            + errors (array[Incorrect Credentials])
    
    
    # Data Structures
    
    ## Incorrect Credentials (enum)
    - Insufficient privileges.