Skip to content

Invalid schema reference error #74

Closed
@SOHELAHMED7

Description

@SOHELAHMED7

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.


Also see #76

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions