SolutionsCloud / apidoc

Api Documentation Generator
http://solutionscloud.github.io/apidoc/demo/
GNU General Public License v3.0
42 stars 10 forks source link

Any code other than 200 results in parser error #62

Open RunOrVeith opened 6 years ago

RunOrVeith commented 6 years ago

This sample YAML file works perfectly if run with

apidoc -i path/to/working_api.yml

configuration:
  title: TestAPI
  description: Demonstrates the bug that any code other than 200 results in a parser error
  uri: localhost:123456/

versions:
  v1.0:
    display: true
    label: Version 1.0
    status: beta
    major: 1
    minor: 0
    methods:
      Test:
        label: TestPost
        uri: /
        code: 200
        method: POST
        description: Submits something, so that HTTP Response 202 is valid

Replacing code: 200 with code: 202 (or any other number that is not 200) results in a parser error:

apidoc -i path/to/broken_api.yml
2018-06-25 15:59:04,516 - ERROR - Failed to parse sources.

From the description of the code parameter from the documentation I can not tell why this should be valid behavior.

code: Normal code returned by the method (default 200). This information will be displayed in the sample generated in the documentation.