generate endpoint for all foreign key relationships
This commit is contained in:
@ -103,6 +103,32 @@ paths:
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
#end if
|
||||
#for $column in $table.columns
|
||||
#if (('foreignkey' in $column) and $column.foreignkey)
|
||||
/v1/${table.name}s/${column.name}/{${column.name}Id}:
|
||||
get:
|
||||
tags: [ "$table.name", "$column.name" ]
|
||||
summary: Return $table.name by $$column.name
|
||||
operationId: methods.get_${table.name}_by_${column.name}
|
||||
parameters:
|
||||
- name: ${column.name}Id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: $table.name response
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
\$ref: '#/components/schemas/$table.name'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
#end if
|
||||
#end for
|
||||
#end for
|
||||
|
||||
#include raw "./api/additional_endpoints.yaml"
|
||||
|
Reference in New Issue
Block a user