Skip to content

Component schema should be optional #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SOHELAHMED7 opened this issue Mar 7, 2025 · 0 comments · Fixed by #97
Closed

Component schema should be optional #96

SOHELAHMED7 opened this issue Mar 7, 2025 · 0 comments · Fixed by #97
Assignees
Milestone

Comments

@SOHELAHMED7
Copy link
Member

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

@SOHELAHMED7 SOHELAHMED7 self-assigned this Mar 7, 2025
@SOHELAHMED7 SOHELAHMED7 linked a pull request Mar 8, 2025 that will close this issue
@cebe cebe added this to the 2.0.0 milestone Mar 12, 2025
@cebe cebe closed this as completed in #97 Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants