Skip to content
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

Invalid schema reference error #74

Open
SOHELAHMED7 opened this issue Dec 25, 2024 · 0 comments · May be fixed by #75
Open

Invalid schema reference error #74

SOHELAHMED7 opened this issue Dec 25, 2024 · 0 comments · May be fixed by #75
Assignees

Comments

@SOHELAHMED7
Copy link
Member

SOHELAHMED7 commented Dec 25, 2024

For master branch, when I run $ ./yii gii/api --ignoreSpecErrors in a project, I get

Exception 'cebe\yii2openapi\lib\exceptions\InvalidDefinitionException' with message 'Invalid schema reference'

in /app/vendor/php-openapi/yii2-openapi/src/lib/openapi/PropertySchema.php:286

The error seems legit. Because yii2-openapi lib tries to find referenced property (e.g. Invoice -> vat_rate) as '/components/schemas/...'.

Schema:

      Invoice:
        vat_rate:
          $ref: './Product.yaml#/properties/vat_rate'

Changes in FakerStubResolver.php file of PR #21 is causing this. It seems like that prior to this change in FakerStubResolver.php this error haven't came on surface.

Prior to 92e2b97 this issue was not observed.

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.

1 participant