Refactor API specs latest

This commit is contained in:
Reckless_Satoshi 2023-11-14 13:38:06 +00:00 committed by Reckless_Satoshi
parent 9405125edf
commit 62c189ebcf
4 changed files with 2020 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<redoc <redoc
spec-url='/assets/schemas/api-v0.5.3.yaml' spec-url='/assets/schemas/api-latest.yaml'
expand-responses='200,201' expand-responses='200,201'
theme='{ theme='{
"colors": { "colors": {

View File

@ -5,7 +5,7 @@ permalink: /docs/api/
sidebar: sidebar:
title: '<img id="side-icon-verybig" src="/assets/vector/cloud.svg"/>API' title: '<img id="side-icon-verybig" src="/assets/vector/cloud.svg"/>API'
nav: docs nav: docs
src: "_pages/docs/03-understand/11-api-v0.5.3.md" src: "_pages/docs/03-understand/11-api-latest.md"
--- ---
{% include api-v0.5.3.html %} {% include api-latest.html %}

File diff suppressed because it is too large Load Diff

View File

@ -7,13 +7,13 @@ from rest_framework.test import APITestCase
# Update api specs to the newest from a running django server (if any) # Update api specs to the newest from a running django server (if any)
try: try:
urllib.request.urlretrieve( urllib.request.urlretrieve(
"http://127.0.0.1:8000/api/schema", "tests/api_specs.yaml" "http://127.0.0.1:8000/api/schema", "docs/assets/schemas/api-latest.yaml"
) )
except Exception as e: except Exception as e:
print(f"Could not fetch current API specs: {e}") print(f"Could not fetch latests API specs: {e}")
print("Using previously existing api_specs.yaml definitions") print("Using previously existing api-latest.yaml definitions from docs")
schema_tester = SchemaTester(schema_file_path="tests/api_specs.yaml") schema_tester = SchemaTester(schema_file_path="docs/assets/schemas/api-latest.yaml")
class BaseAPITestCase(APITestCase): class BaseAPITestCase(APITestCase):