Skip to content

Commit

Permalink
Merge branch 'dev' into new-dynamo-branch2
Browse files Browse the repository at this point in the history
  • Loading branch information
farisdurrani committed May 26, 2023
2 parents f6c5f4a + 9225ddd commit 84115fa
Show file tree
Hide file tree
Showing 16 changed files with 1,589 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/open-api-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: OpenAPI Schema Validation

on:
push:
paths:
- "backend/openapi/**"
pull_request:
paths:
- "backend/openapi/**"

jobs:
validate:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Check file extensions
run: |
shopt -s globstar
for file in backend/openapi/**/*.yaml; do
if [[ ! "$file" =~ \.openapi\.yaml$ ]]; then
echo "Error: $file does not have the .openapi.yaml extension"
exit 1
fi
done
- name: Validate OpenAPI files
run: |
yarn add swagger-cli
for file in backend/openapi/*.yaml
do
echo "Validating $file"
yarn swagger-cli validate $file --no-color || exit 1
done
46 changes: 46 additions & 0 deletions backend/openapi/defaultDataset.openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
openapi: "3.0.0"
info:
title: DLP API
description: API endpoints for the Deep Learning Playground Project
version: "1.0.0"
paths:
/api/defaultDataset:
post:
description: Endpoint to get user selected default dataset for training
requestBody:
content:
application/json:
schema:
type: string
required:
- using_default_dataset
properties:
using_default_dataset:
type: string
description: dataset selected for training
example:
using_default_dataset: "IRIS"
required: true
responses:
"200":
description: Dataset selected successfully
content:
application/json:
schema:
type: object
properties:
columns:
type: array
example: [col1, col2, col3]
"400":
description: Dataset wasn't selected properly. This is usually something wrong with your code
"401":
description: User is not authenticated
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "User is not authenticated"
Loading

0 comments on commit 84115fa

Please sign in to comment.