Skip to content

"Nullable" fields have wrong type #39

@tobias-tengler

Description

@tobias-tengler

The difference between a "nullable" and a non-null field is currently handled using the "required" property on the JSON schema object. This is only partly correct, as a nullable field can either be not specified (it is not required) or it can be assigned null.

The required behavior should stay, but if the field is not declared as non-null, the fields should be as follows:

Lists

{
   "type": ["array", "null"]
}

Types

{
   "type":{
      "oneOf":[
         {
            // or whatever the actual type is
            "type":"string"
         },
         {
            "type":"null"
         }
      ]
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions