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.

Prevent _id suffix in column name on reference properties  #90

Closed
SOHELAHMED7/yii2-openapi
#21
@SOHELAHMED7

Description

@SOHELAHMED7

I have Open API model that represents a DB table

# del:
title: Del
x-table: del
type: object


required:
  - id 
  - user

  # ...

properties:

  id:
    type: integer
    readOnly: true
    example: 1337

  user:
    $ref: '../openapi.yaml#/components/schemas/User' # this will automatically create `user_id` columns

    # ...

here _id is automatically get suffixed to user. That is helpful in lot of cases.

However in certain cases, I would like to have column name that is a reference but not suffixed by _id and having custom column name

Example:

# del:
title: Del
x-table: del
type: object


required:
  - id 

  # ...

properties:

  id:
    type: integer
    readOnly: true
    example: 1337

  redelivery_of:
    $ref: '../openapi.yaml#/components/schemas/Del' 

    # ...

this redelivery_of reference to PK of same table and custom column name needed here is redelivery_of instead of redelivery_of_id

Meta:

  • feature request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    ✅ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions