Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Can not define index on relation id #168

@cebe

Description

@cebe
components:
  schemas:
    Webhook:
      x-indexes:
        - 'unique:user_id,name' # references implicit ID
      type: object
      description: example for x-fk-column-name
      properties:
        id:
          type: integer
        name:
          type: string
        user:
          $ref: '#/components/schemas/User' # this will automatically create `user_id` column

results in:

cebe\yii2openapi\lib\exceptions\InvalidDefinitionException: Invalid index definition - property user_id not declared

/app/src/lib/AttributeResolver.php:441
/app/src/lib/AttributeResolver.php:124
/app/src/lib/SchemaToDatabase.php:93
/app/src/generator/ApiGenerator.php:471

I'll submit a failing test case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions