forked from gsn/predictor
feat: added API specification
This commit is contained in:
parent
7ce1202d87
commit
419c07886c
4 changed files with 79 additions and 0 deletions
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"makefile.configureOnOpen": false
|
||||||
|
}
|
||||||
2
Makefile
Normal file
2
Makefile
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
generate-ogen:
|
||||||
|
go run github.com/ogen-go/ogen/cmd/ogen@latest --target pkg/rest -package gsn --clean api/rest/predictor.swagger.yml
|
||||||
71
api/rest/predictor.swagger.yml
Normal file
71
api/rest/predictor.swagger.yml
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
openapi: 3.0.4
|
||||||
|
info:
|
||||||
|
title: GSN Predictor - OpenAPI 3.0
|
||||||
|
version: 0.0.1
|
||||||
|
paths:
|
||||||
|
/api/v1/prediction:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- Prediction
|
||||||
|
summary: Perform preidction
|
||||||
|
operationId: performPrediction
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: parameters
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Prediction/Parameters'
|
||||||
|
style: form
|
||||||
|
explode: true
|
||||||
|
requestBody:
|
||||||
|
required: false
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Prediction/Parameters'
|
||||||
|
|
||||||
|
components:
|
||||||
|
schemas:
|
||||||
|
Prediction:
|
||||||
|
Parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
launch_latitude: # TODO: altitude not required with fallback to https://github.com/priyeshpatel/ruaumoko Go analog
|
||||||
|
type: number
|
||||||
|
launch_longitude:
|
||||||
|
type: number
|
||||||
|
launch_datetime:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
launch_altitude:
|
||||||
|
type: number
|
||||||
|
profile:
|
||||||
|
type: string
|
||||||
|
enum: ["standard_profile", "float_profile", "reverse_profile", "custom_profile"]
|
||||||
|
ascent_rate:
|
||||||
|
type: number
|
||||||
|
burst_altitude:
|
||||||
|
type: number
|
||||||
|
descent_rate:
|
||||||
|
type: number
|
||||||
|
float_altitude:
|
||||||
|
type: number
|
||||||
|
stop_datetime:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
ascent_curve:
|
||||||
|
type: string
|
||||||
|
description: "Base64 encoded ascent curve"
|
||||||
|
descent_curve:
|
||||||
|
type: string
|
||||||
|
description: "Base64 encoded descent curve"
|
||||||
|
interpolate:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
format: # TODO: custom output format (csv, kml) with json as default
|
||||||
|
type: string
|
||||||
|
enum: ["json"]
|
||||||
|
default: json
|
||||||
|
dataset:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
3
go.mod
Normal file
3
go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
module git.intra.yksa.space/gsn/predictor
|
||||||
|
|
||||||
|
go 1.24.4
|
||||||
Loading…
Add table
Add a link
Reference in a new issue