Skip to content

Component schema should be optional #96

Closed
@SOHELAHMED7

Description

@SOHELAHMED7

This is a valid OpenAPI spec without component schema:

openapi: "3.0.0"
info:
  version: 1.0.0
  title: 79_response_status_codes_are_not_the_codes_defined_in_spec
paths:
  /mango/cake:
    get:
      responses:
        '200':
          description: The information
        '403':
          description: The information
        '404':
          description: The information
    post:
      responses:
        '201':
          description: The information
        '403':
          description: The information
        '404':
          description: The information
        '422':
          description: The information

While reading this spec, I get an error

1) tests\unit\IssueFixTest::test79ResponseStatusCodesAreNotTheCodesDefinedInSpec
yii\base\ErrorException: Trying to get property 'schemas' of non-object

/app/src/lib/SchemaToDatabase.php:156
/app/src/lib/SchemaToDatabase.php:96
/app/src/generator/ApiGenerator.php:490
/app/tests/DbTestCase.php:63
/app/tests/unit/IssueFixTest.php:1022
phpvfscomposer:///app/vendor/phpunit/phpunit/phpunit:97

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions