Files
genericdatabaseapiservice/openapi.yaml

168 lines
4.4 KiB
YAML

openapi: 3.0.0
info:
title: Generic Database API Service
version: "2.0.0"
paths:
/pdb/v2/test1:
get:
tags: [ "Regular" ]
operationId: Regular.test1all
summary: Returns all entries from table test1
responses:
200:
description: Here are your test1 items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/test1"
404:
description: No test1 items available
# post:
# tags: [ "Regular" ]
# operationId: Regular.test1insert
# summary: Inserts an item into table test1
# requestBody:
# description: test1
# content:
# application/json:
# schema:
# $ref: "#/components/schemas/test1"
# responses:
# 201:
# description: Your items has been inserted
/pdb/v2/test1/specificSelectName/{txt}:
get:
tags: [ "Regular" ]
operationId: Regular.test1specificSelectName
summary: Returns entries from table test1 using a dedicated select statement
description:
STATEMENTBEGIN
select nr, txt
from test1
where txt = @txt
STATEMENTEND
parameters:
- name: txt
in: path
required: true
schema:
type: string
responses:
200:
description: Here are your test1 items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/specificResultType"
404:
description: No such test1 item available
/pdb/v2/productionOrder/{productionOrderNumber}:
get:
tags: [ "Regular" ]
operationId: Regular.productionOrder
summary: Returns productionOrder entries
description:
STATEMENTBEGIN
SELECT produktionsauftrag AS productionOrderNumber,
C_Nummer AS cNumber,
artikelcode AS articleCode,
stueckzahl AS numOfParts,
IX AS ix,
referenz_dokument AS referenceDocument
FROM auftraege
WHERE produktionsauftrag = @productionOrderNumber
STATEMENTEND
parameters:
- name: productionOrderNumber
in: path
required: true
schema:
type: string
responses:
200:
description: Here are your productionOrder items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/productionOrder"
404:
description: No such productionOrder entries available
/pdb/v2/baseData/{articleNumber}:
get:
tags: [ "Regular" ]
operationId: Regular.baseData
summary: Returns baseData entries
description:
STATEMENTBEGIN
SELECT Artikelcode,
Art,
bezeichnung
FROM stammdaten
WHERE Artikelcode = @articleNumber
STATEMENTEND
parameters:
- name: articleNumber
in: path
required: true
schema:
type: string
responses:
200:
description: Here are your productionOrder items
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/productionOrder"
404:
description: No such productionOrder entries available
components:
schemas:
test1:
description: A test1 item
type: object
required:
- id
properties:
id:
type: integer
txt:
type: string
nr:
type: integer
specificResultType:
description: Specific result type to defintion select clause
type: object
properties:
txt:
type: string
nr:
type: integer
productionOrder:
description: Selecting columns of the auftraege table from pdb_el
type: object
properties:
productionOrderNumber:
type: string
cNumber:
type: string
nullable: true
articleCode:
type: string
numOfParts:
type: integer
ix:
type: string
referenceDocument:
type: string