Skip to content

Commit 90fc7ac

Browse files
committed
Fix OpenAPI generation and mount models.py in compose
1 parent 0438638 commit 90fc7ac

3 files changed

Lines changed: 158 additions & 10 deletions

File tree

recorder-backend/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ services:
3030
volumes:
3131
# Mount source for hot-reload during development
3232
- ./main.py:/app/main.py
33+
- ./models.py:/app/models.py
3334
- ./storage.py:/app/storage.py
3435
- ./yle_utils.py:/app/yle_utils.py
3536
command: "uvicorn main:app --host 0.0.0.0 --port 8000 --reload"

recorder-backend/generate-openapi.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ if ! curl -s http://localhost:8000/ > /dev/null 2>&1; then
1313
fi
1414

1515
# Fetch OpenAPI spec
16-
curl -s http://localhost:8000/openapi.json > openapi.json
16+
curl http://localhost:8000/openapi.json | uv run python -m json.tool > openapi.json
1717

1818
echo "✓ Generated openapi.json ($(wc -c < openapi.json | tr -d ' ') bytes)"
19-
echo ""
20-
echo "Use this file to generate MAUI client:"
21-
echo " nswag run nswag.example.json"
22-
echo " # or"
23-
echo " kiota generate -l CSharp -d openapi.json -o Generated"

recorder-backend/openapi.json

Lines changed: 156 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,91 @@
595595
"url": {
596596
"type": "string",
597597
"title": "Url",
598-
"description": "YLE program ID (not decrypted)"
598+
"description": "YLE program ID"
599+
},
600+
"typeId": {
601+
"anyOf": [
602+
{
603+
"type": "string"
604+
},
605+
{
606+
"type": "null"
607+
}
608+
],
609+
"title": "Typeid",
610+
"description": "MIME type"
611+
},
612+
"default": {
613+
"$ref": "#/components/schemas/MediaState",
614+
"description": "Default/initial state"
615+
},
616+
"options": {
617+
"items": {},
618+
"type": "array",
619+
"title": "Options",
620+
"description": "Empty list for media items"
621+
},
622+
"isRecording": {
623+
"type": "boolean",
624+
"title": "Isrecording"
625+
},
626+
"start": {
627+
"anyOf": [
628+
{
629+
"$ref": "#/components/schemas/MediaState"
630+
},
631+
{
632+
"type": "null"
633+
}
634+
],
635+
"description": "State before recording starts"
636+
},
637+
"recording": {
638+
"anyOf": [
639+
{
640+
"$ref": "#/components/schemas/MediaState"
641+
},
642+
{
643+
"type": "null"
644+
}
645+
],
646+
"description": "State during recording"
647+
},
648+
"finish": {
649+
"anyOf": [
650+
{
651+
"$ref": "#/components/schemas/MediaState"
652+
},
653+
{
654+
"type": "null"
655+
}
656+
],
657+
"description": "State after recording finishes"
658+
},
659+
"metaTitle": {
660+
"anyOf": [
661+
{
662+
"additionalProperties": {
663+
"type": "string"
664+
},
665+
"type": "object"
666+
},
667+
{
668+
"type": "null"
669+
}
670+
],
671+
"title": "Metatitle",
672+
"description": "Optional meta title"
599673
}
600674
},
601675
"type": "object",
602676
"required": [
603677
"kind",
604678
"itemType",
605679
"itemId",
606-
"url"
680+
"url",
681+
"default",
682+
"isRecording"
607683
],
608684
"title": "FakeYleAudioMediaItem",
609685
"description": "Fake YLE audio item returned when YLE credentials are not configured"
@@ -628,15 +704,91 @@
628704
"url": {
629705
"type": "string",
630706
"title": "Url",
631-
"description": "YLE program ID (not decrypted)"
707+
"description": "YLE program ID"
708+
},
709+
"typeId": {
710+
"anyOf": [
711+
{
712+
"type": "string"
713+
},
714+
{
715+
"type": "null"
716+
}
717+
],
718+
"title": "Typeid",
719+
"description": "MIME type"
720+
},
721+
"default": {
722+
"$ref": "#/components/schemas/MediaState",
723+
"description": "Default/initial state"
724+
},
725+
"options": {
726+
"items": {},
727+
"type": "array",
728+
"title": "Options",
729+
"description": "Empty list for media items"
730+
},
731+
"isRecording": {
732+
"type": "boolean",
733+
"title": "Isrecording"
734+
},
735+
"start": {
736+
"anyOf": [
737+
{
738+
"$ref": "#/components/schemas/MediaState"
739+
},
740+
{
741+
"type": "null"
742+
}
743+
],
744+
"description": "State before recording starts"
745+
},
746+
"recording": {
747+
"anyOf": [
748+
{
749+
"$ref": "#/components/schemas/MediaState"
750+
},
751+
{
752+
"type": "null"
753+
}
754+
],
755+
"description": "State during recording"
756+
},
757+
"finish": {
758+
"anyOf": [
759+
{
760+
"$ref": "#/components/schemas/MediaState"
761+
},
762+
{
763+
"type": "null"
764+
}
765+
],
766+
"description": "State after recording finishes"
767+
},
768+
"metaTitle": {
769+
"anyOf": [
770+
{
771+
"additionalProperties": {
772+
"type": "string"
773+
},
774+
"type": "object"
775+
},
776+
{
777+
"type": "null"
778+
}
779+
],
780+
"title": "Metatitle",
781+
"description": "Optional meta title"
632782
}
633783
},
634784
"type": "object",
635785
"required": [
636786
"kind",
637787
"itemType",
638788
"itemId",
639-
"url"
789+
"url",
790+
"default",
791+
"isRecording"
640792
],
641793
"title": "FakeYleVideoMediaItem",
642794
"description": "Fake YLE video item returned when YLE credentials are not configured"

0 commit comments

Comments
 (0)