mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
Generate OpenAPI 3 schemas from the swagger 2.0 generation (#1017)
* Generate OpenAPI 3 schemas from the swagger 2.0 generation * Update API description URL in index.md
This commit is contained in:
@@ -23,10 +23,13 @@ tasks:
|
||||
INTERNAL: "../../../internal"
|
||||
PKGS: "../../../pkgs"
|
||||
cmds:
|
||||
- swag fmt --dir={{ .API }}
|
||||
- swag init --dir={{ .API }},{{ .INTERNAL }}/core/services,{{ .INTERNAL }}/data/repo --parseDependency
|
||||
- cp -r ./docs/swagger.json ../../../../docs/en/api/openapi-2.0.json
|
||||
- cp -r ./docs/swagger.yaml ../../../../docs/en/api/openapi-2.0.yaml
|
||||
- npx -y -p swagger2openapi swagger2openapi --outfile ./docs/openapi-3.json ./docs/swagger.json
|
||||
- npx -y -p swagger2openapi swagger2openapi --yaml --outfile ./docs/openapi-3.yaml ./docs/swagger.json
|
||||
- cp -r ./docs/swagger.json ../../../../docs/en/api/swagger-2.0.json
|
||||
- cp -r ./docs/swagger.yaml ../../../../docs/en/api/swagger-2.0.yaml
|
||||
- cp -r ./docs/openapi-3.json ../../../../docs/en/api/openapi-3.0.json
|
||||
- cp -r ./docs/openapi-3.yaml ../../../../docs/en/api/openapi-3.0.yaml
|
||||
sources:
|
||||
- "./backend/app/api/**/*"
|
||||
- "./backend/internal/data/**"
|
||||
|
||||
@@ -2240,6 +2240,9 @@ const docTemplate = `{
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"decimals": {
|
||||
"type": "integer"
|
||||
},
|
||||
"local": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
4550
backend/app/api/static/docs/openapi-3.json
Normal file
4550
backend/app/api/static/docs/openapi-3.json
Normal file
File diff suppressed because it is too large
Load Diff
2888
backend/app/api/static/docs/openapi-3.yaml
Normal file
2888
backend/app/api/static/docs/openapi-3.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2238,6 +2238,9 @@
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"decimals": {
|
||||
"type": "integer"
|
||||
},
|
||||
"local": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -34,6 +34,8 @@ definitions:
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
decimals:
|
||||
type: integer
|
||||
local:
|
||||
type: string
|
||||
name:
|
||||
|
||||
@@ -50,7 +50,7 @@ document.head.appendChild(elementStyle);
|
||||
<client-only>
|
||||
<elements-api
|
||||
:key="componentKey"
|
||||
apiDescriptionUrl="https://raw.githubusercontent.com/sysadminsmedia/homebox/refs/heads/main/docs/en/api/openapi-2.0.json"
|
||||
apiDescriptionUrl="https://raw.githubusercontent.com/sysadminsmedia/homebox/refs/heads/main/docs/en/api/openapi-3.0.json"
|
||||
router="hash"
|
||||
layout="responsive"
|
||||
hideSchemas="true"
|
||||
|
||||
4550
docs/en/api/openapi-3.0.json
Normal file
4550
docs/en/api/openapi-3.0.json
Normal file
File diff suppressed because it is too large
Load Diff
2888
docs/en/api/openapi-3.0.yaml
Normal file
2888
docs/en/api/openapi-3.0.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2238,6 +2238,9 @@
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"decimals": {
|
||||
"type": "integer"
|
||||
},
|
||||
"local": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -34,6 +34,8 @@ definitions:
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
decimals:
|
||||
type: integer
|
||||
local:
|
||||
type: string
|
||||
name:
|
||||
Reference in New Issue
Block a user