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"
|
INTERNAL: "../../../internal"
|
||||||
PKGS: "../../../pkgs"
|
PKGS: "../../../pkgs"
|
||||||
cmds:
|
cmds:
|
||||||
- swag fmt --dir={{ .API }}
|
|
||||||
- swag init --dir={{ .API }},{{ .INTERNAL }}/core/services,{{ .INTERNAL }}/data/repo --parseDependency
|
- swag init --dir={{ .API }},{{ .INTERNAL }}/core/services,{{ .INTERNAL }}/data/repo --parseDependency
|
||||||
- cp -r ./docs/swagger.json ../../../../docs/en/api/openapi-2.0.json
|
- npx -y -p swagger2openapi swagger2openapi --outfile ./docs/openapi-3.json ./docs/swagger.json
|
||||||
- cp -r ./docs/swagger.yaml ../../../../docs/en/api/openapi-2.0.yaml
|
- 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:
|
sources:
|
||||||
- "./backend/app/api/**/*"
|
- "./backend/app/api/**/*"
|
||||||
- "./backend/internal/data/**"
|
- "./backend/internal/data/**"
|
||||||
|
|||||||
@@ -2240,6 +2240,9 @@ const docTemplate = `{
|
|||||||
"code": {
|
"code": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"decimals": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"local": {
|
"local": {
|
||||||
"type": "string"
|
"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": {
|
"code": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"decimals": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"local": {
|
"local": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ definitions:
|
|||||||
properties:
|
properties:
|
||||||
code:
|
code:
|
||||||
type: string
|
type: string
|
||||||
|
decimals:
|
||||||
|
type: integer
|
||||||
local:
|
local:
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ document.head.appendChild(elementStyle);
|
|||||||
<client-only>
|
<client-only>
|
||||||
<elements-api
|
<elements-api
|
||||||
:key="componentKey"
|
: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"
|
router="hash"
|
||||||
layout="responsive"
|
layout="responsive"
|
||||||
hideSchemas="true"
|
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": {
|
"code": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"decimals": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"local": {
|
"local": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -34,6 +34,8 @@ definitions:
|
|||||||
properties:
|
properties:
|
||||||
code:
|
code:
|
||||||
type: string
|
type: string
|
||||||
|
decimals:
|
||||||
|
type: integer
|
||||||
local:
|
local:
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
Reference in New Issue
Block a user