Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very firs attempt at an OpenAPI description of the API #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions doc/swagger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
openapi: 3.0.3
servers:
# Added by API Auto Mocking Plugin
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/FranckCo/Trevas-API/0.0.1
- description: Localhost server
url: http://localhost/api/vtl

info:
description: A simple API wrapping the Trevas VTL engine
version: "0.0.1"
title: Trevas API
contact:
email: [email protected]
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'
tags:
- name: execution
description: Execution of VTL scripts
- name: monitoring
description: Monitoring of submitted execution jobs
paths:
/job/{jobId}:
get:
tags:
- monitoring
summary: Get monitoring information on a job
parameters:
- name: jobId
in: path
description: Job identifier
required: true
schema:
$ref: '#/components/schemas/JobID'
responses:
'200':
description: Job status
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'404':
description: Unkown job identifier
/in-memory:
post:
tags:
- execution
summary: Executes a VTL script in memory
operationId: executeInMemory
description: Receives a script and bindings, returns output bindings
responses:
'200':
description: Script executed
content:
application/json:
schema:
$ref: '#/components/schemas/Bindings'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Body'
description: VTL script and input bindings
components:
schemas:
# With version 3.1.0 of OpenAPI, JobID can be described as
# type: object
# propertyNames:
# format: uuid
JobID:
type: string
format: uuid
example: d290f1ee-6c54-4b01-90e6-d701748f0851
Job:
type: object
required:
- id
- status
# Complete properties
properties:
id:
$ref: '#/components/schemas/JobID'
status:
type: string
Bindings:
type: string
# Complete description of Bindings, which has type javax.script.Bindings
Body:
type: object
properties:
script:
type: string
bindings:
$ref: '#/components/schemas/Bindings'