Search code examples
swaggeropenapiswagger-2.0dredd

dredd fails to run with errors 'Data does not match any schemas from 'anyOf' and such more


Trying to run dredd on swagger documentation. Dredd fails with next errors:

- error: API description parser error in /albums.json:266 (from line 266 column 10 to column 21): Data does not match any schemas from 'anyOf'    
- error: API description parser error in /albums.json:266 (from line 266 column 10 to column 21): No enum match for: s
- error: API description parser error in /albums.json:266 (from line 266 column 10 to column 21): Expected type array but found type string

errors refers to this part of JSON:

265  "photos": { "$ref": "#/definitions/PhotoEntity" },
266  "created_at": {
267    "type": "s",
268    "format": "g",
269    "description": "Дата создания"
270  }

Full JSON available by gist. Swagger-ui work with this JSON perfectly, manual testing passes, as expected.


Solution

  • Replace

    "type": "s",
    

    with

    "type": "string",
    


    There're also other errors in your API definition - use https://editor.swagger.io to check for syntax errors.