danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 480 forks source link

enum has null values in JSON schema output #300

Open rdgreen opened 7 years ago

rdgreen commented 7 years ago

Running aglio on this file produces a JSON schema for GET /notes like this:

{
  "type": "array",
  "items": {
    "enum": [
      null,
      null
    ]
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Note the two nulls. enum in JSON schema can't accept subschemas, so oneOf should be generated instead, and the nulls should be replaced with the actual JSON subschemas.